Extract Datatable page number

Hi All,
How can i know which page am in for instance first or last page or “n” page from an extracted datatable using data scraping method.

Thanks in advance.

Hi @mozahra

There are different approaches to extract data using data scraping wizard.

  1. Directly use the data scraping wizard along with its page number tracking mechanism. This will be fully automated by the wizard. What happens here is while you configure the wizard along with the fields you specify to extract, it also asks you where to find the next page option. So when that’s configure and when you are running it, it will automatically do the extract and page change until the next page option is disabled or not visible. Basically it will run through all the pages. However in this option you will not be able to track the page number at a moment it’s in.

  2. Here data scraping is handled partially by the wizard and partially by how you configure the next page option. But you will need to manually configure the extract structured data activity to extract data from that particular page. Here how to change the page number depends on a different mechanism. You have to write a workflow that runs within a loop. Each iteration it changes the page incrementing the page number by one. And use a click activity on the next page to change the page in each iteration. After that, within the same loop have the extract structured data activity to extract the data in the page


@Lahiru.Fernando so if I understand you correctly the automated way can’t help to find the pages and hence the same for a Datatable?

Hi @mozahra

From the two points I described, if you use the first option you will not be able to get the page number to a variable because it is handled from the data scraping wizard internally. However if you use the second option I have listed here, then the page number is handled by your workflow, and the data scraping will happen only in that particular page you are in. So each time you can change the page number in the loop while keeping track of it and the data scraping will happen for each page separately within the loop. So if you wish to keep track of the page number which the data scraping is happening currently, second option would be the best approach :slight_smile:

1 Like

You can try getting the page number based on the row index.

Let’s say it’s standard in the website that each page contains 60 items and the row index is 61, you can divide the row index and round up.

Hi @Lahiru.Fernando,

i read your solution and find it very useful.

like i have same situation and i need your help.

in my case i have used data scraping to scrap all the pages of datatable. please find image of my Pagination.
But the problem is when i am using the datascraping for all the pages, and after scraping it will go to page 5, now i want that it should come back to 1st page and start doing operation and once the operation is done for 1st page then it should change 2nd page and so on until last page.
one more thing i tried click activity to select page number 1 but when i try to capture page 1 by clicking the image ,it goes off. so i am not able to do it.
note- page number is dynamic.

kindly help to solve this.
Thanks in advance

Hi @Rakesh_Tiwari

So I think from what I understood, the next arrow button takes you to the last page instead of the second page?

So you want to use the dropdown to navigate through pages is it?

So for the dropdown, you can introduce a loop here.
each iteration, keep on incrementing a numeric variable that is equal to the numbers you see in the dropdown.
For you to indicate using the click follow the below steps…

  • Click activity → Indicate on screen
  • Press F2 to pause the indication for 3 seconds…
  • in the meantime, quickly open the dropdown menu and wait for the indication operation to resume. Once it does, indicate one item from the dropdown.
  • Now make that selector dynamic using the incrementing variable so it will try to click on that.

I think you will need to place your data scraping activity inside the loop in this case…

yes, i want to navigate to each page using dropdown.

but what is happening is when datascraping starts it starts page by page and it will be on last page at the end and i want it to be back on first page.

whan i used click activity to select page one and pressed f2 button, it gave me this error.
i tried changing timeout and wait for ready also but found no luck.

Have you tried using two click activities?

One to click on the dropdown to expand the list, and the other to click on the item on the expanded list… This might work… :thinking:

Also check whether your selectors are valid

what is happening is, whan i clcik on dropdown menu and go back to uipath and click on indicate on screen, the dropdown list will go off like this image
And when try using f2 button, then throws error

is there any other way to handle this?