mouse.wheel, wait_for_function, evaluate_all and route
Ask your AI agent
With the Zenrows MCP server connected to Claude, Cursor or any MCP client, paste this prompt. Your agent picks the right Zenrows tools and settings on its own.Scroll an infinite feed to the end
Scroll, then wait for the page to add items. When no new items arrive within five seconds, you reached the end. Blocking images keeps the session light, since the data is in the text.Follow “Next” links to the last page
Read the items on the page, click the “Next” link, and repeat until the link is gone.Example output
Infinite scroll:Customize it
Troubleshooting
- The loop stops early: the next set of items took longer than the wait. Raise
timeoutinwait_for_functionto 10000. - The CSV has duplicate rows: the feed re-sends items while loading. Keep one row per URL, as the scroll example does.
page.gototimes out waiting forload: a script or asset on the page keeps loading. Passwait_until="domcontentloaded".- The click on “Next” waits until it times out: the site navigates in a way Playwright does not track as a page load. Read the link’s
hrefand callpage.goto(href)instead of clicking.
Related recipes
Run browser sessions in parallel
Scrape many listings at once with a concurrency limit.
Fill and submit multi-step forms
Search, filter and submit before you collect the results.
Turn a whole catalog into a structured dataset
Turn a whole catalog into a clean dataset.
Click, fill, and scroll before you scrape
Scroll and click with js_instructions in one request.