Skip to content

Paginate

Paginate

Follow a bounded run of pages and get every page with one combined receipt.

paginate follows a sequence of pages through one adapter, such as a JSON API’s ?page= parameter, and returns each page with an aggregate receipt.

  • Bounded by max_pages, so it never runs away.
  • Each page is an ordinary read: paced, receipted and able to climb past walls.
  • Use continuation_adapter when later pages need a different adapter from the first.
run = await web.paginate("https://shop.example.com/products.json?page=1", "json",
policy_overrides={"max_pages": 5})
Option Default Description
adapter required html, json or rss.
max_pages 2 Most pages to follow.
continuation_adapter same as adapter Adapter for pages after the first.