NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

Web scraping

How do I scrape pages with infinite scroll?

The cleanest way is to find the request the page fires when you scroll and call it directly; if that is not practical, scroll in a browser until the list stops growing.

Two approaches

Infinite scroll is just pagination with the buttons hidden. As you scroll, the page calls an endpoint for the next batch, usually returning JSON, and appends the items. You can either call that endpoint yourself with a plain HTTP client, which is fast and light, or drive a headless browser to scroll for you, which is slower but works when the endpoint is hard to reproduce.

Finding the load-more request

Open the developer tools, go to the network panel, filter by Fetch/XHR and scroll down. A new request appears each time a batch loads. Look at its URL and payload for a page number, an offset, or a cursor such as after=eyJpZCI6.... Copy it as cURL to see every header the browser sent. Then reproduce the loop:

import requests

feed = requests.Session()
feed.headers.update({"Accept": "application/json", "Referer": "https://board.example.com/jobs"})
cursor, collected = None, []
while True:
    params = {"limit": 40}
    if cursor:
        params["after"] = cursor
    batch = feed.get("https://board.example.com/api/jobs", params=params, timeout=20).json()
    collected.extend(batch["items"])
    cursor = batch.get("nextCursor")
    if not cursor or not batch["items"]:
        break
print(len(collected), "jobs")

Cursor based APIs are reliable: each reply tells you exactly where to continue, and the loop ends when there is no next cursor.

Scrolling in a browser

When the endpoint needs signed parameters or tokens generated by scripts, let the page do the work. The pattern is: scroll to the bottom, wait for new items, count them, and stop when the count stops growing.

import pwLib from "playwright";

const scroller = await pwLib.chromium.launch({ headless: true });
const page = await scroller.newPage();
await page.goto("https://board.example.com/jobs");
let seen = 0;
for (let round = 0; round < 60; round++) {
  await page.mouse.wheel(0, 4000);
  await page.waitForTimeout(1200);
  const now = await page.locator("article.job").count();
  if (now === seen) break;
  seen = now;
}
const titles = await page.locator("article.job h3").allInnerTexts();
await scroller.close();

Waiting on a fixed timeout is simple but slow. A better wait listens for the network response that delivers the next batch, or for the item count to change, with a timeout as a safety net.

Pitfalls

  • Virtualized lists. Some sites remove items that scrolled out of view to save memory, so counting DOM nodes at the end gives only the last screen. Collect items as you go.
  • Endless feeds. Social and news feeds may never end. Set a cap on pages or on item age.
  • Duplicates. Batches can overlap when new items are added during your run. Deduplicate by item id.
  • Rate limits. Scrolling fast fires requests fast. Leave a pause between batches, or you will meet HTTP 429 replies.

When a challenge interrupts the scroll

Long scroll sessions sometimes trigger a check partway through: a Turnstile widget appears, or the API starts returning a challenge instead of JSON. In a browser, detect the widget, solve it with a Turnstile task, inject the token and continue. With plain requests, a full Cloudflare challenge needs a clearance cookie earned through your proxy, after which the API calls work again for that session. Spacing requests out usually makes these interruptions rare.

Which approach to choose

Use the API loop whenever you can reproduce it; it is typically many times faster and uses a fraction of the memory. Keep the browser for sites where tokens or signatures are generated in JavaScript. The page on dynamic scraping and the Playwright scraping guide go further into both.

Whichever route you take, save the raw batches you receive before parsing them. If a parser bug appears later, you can fix it and rerun over the saved files instead of scrolling the site again.

Common questions

How do I know when infinite scroll has ended?

In the API loop, when there is no next cursor or an empty batch; in a browser, when the item count stops growing after a scroll.

Is the load-more API allowed to be called directly?

It is the same public data the page shows, but respect the site's terms and keep a modest rate.

Why do I only get the last 20 items in the browser?

The list is probably virtualized and drops off-screen items. Collect items after each scroll instead of at the end.

Does Selenium work for infinite scroll too?

Yes. Execute window.scrollTo in a loop and check the item count, the same idea as in Playwright.

How fast should I scroll?

Slowly enough that each batch loads fully, typically one to two seconds between scrolls.

Keep reading