rubber-blueR
Apify & Crawlee4y ago
2 replies
rubber-blue

Handling pagination within Apify task?

I've created a Playwright scraper task in the Apify web app.

I'm trying to sort out how to handle pagination that -

* uses a link bar bar (instead of lazy loading items)
* doesn't show the last page number until you've navigated within a few pages of end
* uses <button> elements for page links (instead of anchor tags with hrefs)

Start  [1] 2 3 4 5  Next >
< Prev  12 13 14 15 [16] End


I want to navigate all of these pages to collect URLs that will be queued for scraping.

The docs mention there's a way to collect paginated URLs using the Pseudo URLs (https://docs.apify.com/tutorials/apify-scrapers/web-scraper#pagination) but don't go into any detail on how to do this. I'm also guessing this approach won't work without an a[href] element.

What would be best way to handle this kind of pagination?

Thanks for any help.

---
Apify
Learn how to scrape a website using Apify's Web Scraper. Build an actor's page function, extract information from a web page and download your data.
Web Scraper · Apify Documentation
Was this page helpful?