Skip to content
On this page

Infinite scroll

Some listings render the first batch of rows server-side, then load each subsequent batch from an endpoint when you scroll to the bottom or click a "Load more" / "Carregar mais" button. There are no page links to follow, so none / link_list / next_link can't help. Set the pagination strategy to infinite_scroll and add an infinite_scroll block.

How it works

The engine fetches the first page normally (so the items already in the HTML are kept), optionally scrapes a CSRF token from it, then repeatedly calls the configured endpoint for the next batch — parsing each returned HTML fragment with the same item_selector — until a batch comes back empty or max_pages is reached. The session cookie set on the first page is reused automatically, so token-protected endpoints work without pasting anything by hand.

Detection only scaffolds a skeleton

Detection can only flag the button (e.g. #btn_carregarMais) and scaffold an infinite_scroll skeleton — the endpoint, parameter and page size can't be seen from static HTML. Open your browser's Network tab, click "Load more" once, and copy the request URL, method and body into the block.

The infinite_scroll block

json
{
  "item_selector": ".card_lotes_div",
  "pagination": { "strategy": "infinite_scroll", "css": "#btn_carregarMais" },
  "infinite_scroll": {
    "endpoint": "https://www.portalzuk.com.br/leilao-de-imoveis/mais",
    "method": "POST",
    "body_format": "form",
    "param": "limit",
    "param_mode": "offset",
    "page_size": 30,
    "start": 30,
    "params": { "path": "t/todos-imoveis/residenciais" },
    "headers": { "X-Requested-With": "XMLHttpRequest" },
    "token": { "css": "input[name=\"_token\"]", "attribute": "value", "param": "_token" },
    "stop_when_empty": true
  },
  "fields": [
    { "name": "url", "css": ".card-property-image-wrapper a", "attribute": "href" },
    { "name": "title", "css": ".card-property-image-wrapper a", "attribute": "title" }
  ],
  "dedup": { "enabled": true, "key_field": "url" }
}
KeyMeaning
endpointURL to call for more rows ("" = the listing URL itself)
methodPOST (most common) or GET
body_formatPOST body encoding: form (urlencoded, default) or json
paramName of the pagination parameter (e.g. limit, page, offset, start)
param_modeoffset = param is the number of rows already loaded; page = param is a page index
page_sizeBatch size; in offset mode this is the step added each call
startParameter value for the second batch (the first page is the initial GET)
paramsExtra static parameters sent on every request
headersExtra request headers (e.g. X-Requested-With)
tokenCSRF/anti-forgery token scraped from the first page: css, attribute ("" = text), param
stop_when_emptyStop as soon as a batch returns no items (default true)

max_pages caps the total number of pages (first page + fragments), and --limit / dedup / result_filters / get_*_images / streaming all behave exactly as in normal HTML mode.

Worked example — Portal Zuk

The "Carregar mais" button fires POST /leilao-de-imoveis/mais with limit (the count of rows already shown, stepping by the page size), path, and a _token read from input[name="_token"]; the response is an HTML fragment of the next cards.

Note Zuk 500s if you send an empty order= — only send parameters the endpoint actually expects.


Next: Multiple categories →

Released under the MIT License.