cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianJenner
New Member

How to stop pager on web extraction?

I have a Desktop Flow and am trying to extract data (a table) from a webpage using a pager using the Recorder function. There are several pages and once it reaches the end, it keeps trying to click on the pager even though the link is gone and the last page has been reached. I can see that once the final page is reached, the code goes from "<button class="link" title="Next Page">›</button>" to "<button class="link" title="Next Page" disabled="">›</button>"

 

How do I get the pager to stop? I tried to stop once UI element <button> disappears but it doesn't work, I think because the button doesn't actually disappear, it just gets disabled once the end is reached. Is there any other way to stop attempting to use the pager, such as if nothing on the site changes for a period of time? Thanks.

16 REPLIES 16
VJR
Super User
Super User

Hi @BrianJenner 

 

Can you check if you are able to play around with these two options and if it stops.

Also try the "all available" option. 

VJR_1-1647314958678.png

 

 

Hi @VJR If the requirement is to extract data from all the available pages, is there any method how to achieve that?

all.png

Henrik_M
Super User
Super User

Try manually editing the pager element to be:

button[class="link"][title="Next Page"]:not([disabled])

Tried this also, will make use of it often in my UI elements 

Tried to use it yet it was still clicking on the last page and this would not step. 

For better understanding, some mistake is done from my side. The pager css selector is:--> div[id="contacts-b-b-grid-paging-toolbar-next"] > div > div > div > img, html > body > div:eq(1) > div > div:eq(1) > div > div:eq(0) > div:eq(1) > div:eq(0) > div > div:eq(1) > div > div:eq(1) > div:eq(0) > div > div:eq(2) > div > div > div:eq(6) > div > div > div > img

 

pager ui element.png

Did it solve your problem. If yes, please share it. 

Henrik_M
Super User
Super User

That does not look like a very good pager selector. Can you supply the HTML code of the page?

The cssSelector manually created is: div[id="contacts-b-b-grid-paging-toolbar-next"]:not([disabled])

 

But this does not move to the next page. It sticks in the first page only. 

HTML code ->

 

Screenshot (443).png

Henrik_M
Super User
Super User

And what about when it is on the last page?

muminmushtaq
Regular Visitor

Here goes the last page:

 

last page.png

Henrik_M
Super User
Super User

You didn't show the whole thing, including <img>

Please find it here 

 

lp2.png

Henrik_M
Super User
Super User

Looks like the code doesn't change at all, which is very strange. BUT just Get details of element on web page the text beside the button, and modify your extract to only take first 82 pages (in this case)

Makes sense?

Not exactly, the pages are dynamic. Today it is 82 tomorrow there may be increase or decrease. So, this will not be a good solution. 

Henrik_M
Super User
Super User

That's why you have to Get details, then either Parse text or Split text to get the number of pages.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Kudoed Authors
Users online (2,246)