Get url from mat-row (Angular Material tables)

Hi,

I need to automate actions on the website built with Angular Material tables. There is a table. If I click on the row, I am redirected to another page.

The url of the page with the table: https://mysite.com/boxes
The url of the page after the click on the row: https://mysite.com/boxes/1234

My goal: read the page with the table and get urls of each row to detect the ID later.

Problem: there are not “a” tags with “href” attribute in the html code.

I suppose Angular generates the url with ID somewhere in the JS code.

Is there a way to get the url or the ID?

HTML code
table

Hi Antonia,

please expand for us the details of a mat-row element. So we inspect all for at least 1 row. Thanks

Sorry, I posted the code of another page. Here is the correct image

Hello @antonina.v ,

Are you able to extract the table using Table extraction? If yes, what about getting the Id’s and searching that ids and clicking on each row.

Is there any option to search and get only one row to click? Also please share the screenshot of the Table you are trying to extract.

Hey @antonina.v

Unable to open the links shared, is that an intranet website ?

Thanks
#nK

Hello @Rahul_Unnikrishnan ,
Yes there is an option to click on the row, get the url in the new window and extract the ID.
But there are 5000 rows and if I click on each row, it will take a lot of time. I need to get IDs to build the correct url later.

Here is a table

Hello @Nithinkrishna ,

It is an example url to show its format. It is not a real website. You can see the screenshots of the website in the comments

@antonina.v If the url is only changing with an ID, then you open it by appending the ID to the default url. I think that will be easy.

Another option is while extracting you can enable get url in the Table extraction. It will help to directly fetch the url. Maybe you can try that as well.

Hey @antonina.v

There should be URL for the same.

Kindly show us by inspecting & highlighting it !

Thanks
#nK

@Rahul_Unnikrishnan yes, I can append the ID to the default url. And that’s exactly what I want to do. But the problem is that I can’t get the ID. There is no ID in the HTML code. I can see the ID only when I click on the row: I am redirected to another page and its url contains the ID.

But without clicking on the row, I cannot get the url or the ID: there is no A tag and the url is generated in Javascript when the event Click is called.

Table Extraction does not work for the same reason: there is no A tag that contains the url.

The Angular Material library handles the Click event to generate the url and redirect to another page. I would like to know if anyone has already automated actions on websites developed with Angular Material.

@Nithinkrishna here is the row and its HTML code.
There is no URL in HTML because Angular Material Library generates the URL in Javascript.
table highlight

maybe you inject some javascript and readout the configured router link

Okay, you mean to say its not available in the HTML but when you click the link is dynamically generated by JS ?

Is that correct !

@Nithinkrishna yes, that’s it

Hey @antonina.v

Is that a public site to check from my side ?

Thanks
#nK

@Nithinkrishna no, it is not a public site.

It is not possible to get the ID in this case, so I’ll use another way to open the desired page without obtaining the ID or exacte url of this page.

Please mention that here which helps

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.