How to loop through each row of web page table

How to read each row data of the html web page table which has dynamic number of rows and data spread across multiple pages and can be accessible via clicking next and previous buttons

You can use Data Scraping activity to get data out of the website.


use For Each Row (under data tables acttivities) to loop through all rows in datatable which you get by Data Scraping UIpath Activity

Use DataScrapping first


Check the condition if data spanning multiple pages as yes and select that next button


This will provide you a datatable

Apply for each loop on this and have the desired values


Hi friends

Actually I want to click a button on each row of the table. When I do data scraping it just brings data and how can I click button now

You are going in a right direction. once the data has been scrapped you can perform click activity within For Each loop


to click the button

Find a unqiue identifier in the data table (Like Name or ID), Each button should have a somewhat unique selector (use click activity and play around with selector)

Edit the selector using the Name/ID (or anything unique or similar) to the button so that the bot clicks the right button everytime

You can probably do this without using any data scraping at all if clicking buttons is your goal.

Hi prankur

Could you please tell me how? Because where I can find the button when the scraped data is stored as text in data table


While using the data scraping you can scrap the url too.
Use the correlated data option while scrapping and later you can redirect to url.

But if you still want to perform click operation you can check the selectors and pass variable to dynamic actor and perform click


I have the same problem.
In For each row activity, for each row it is clicking the same row.
How can it click the row in serial wise for each row???

If you have example url let me know, we had similar situation with our client application and we can able to do it…

In the above image i need to click the first row, and then the second row and so on.

What i am doing:
Scraping the data,
getting data through output data table,
And for each row in table
Clicking the row,
opening it,
closing it.
And the row should be click in serial wise.

But after this not getting the expected output.

(selcntrl) Variable selector: “”

Test the selector once, give wireline and check proper selectors are passed or not

In the above example, the selcntrl variable has assign this value.

Hi @Priya250,

Did you get the solution for your query?

Because i am also stuck in same situation.

you can set a variable in your selector for each row and then click that button.