RFC: Automatic pagination detection for crawls (reduce manual “next page” rules) #285
Replies: 2 comments
|
Following up on this RFC with a clearer two-phase plan. The roadmap item is “auto-detect pagination URLs". Phase 1 — find the next link in HTMLMany sites already put the next page in the markup. Today every spider writes the same logic by hand. Phase 1 would be a small helper that looks at a response and returns the next page URL if it finds one. It would check common patterns in order: rel="next", obvious “next” navigation, link text like “Next” or “›”, and simple URL patterns like /page/2 or ?page=2. If nothing matches, it returns nothing. This stays lightweight Phase 2 — pagination that needs a browserSome sites don’t expose a next URL in the HTML. Content loads when you scroll, click “Load more”, or wait for JavaScript. That’s a different problem which needs a live browser, not HTML parsing alone. Scrapling already supports browser automation via DynamicFetcher, StealthyFetcher, and page_action. Phase 2 would add a reusable helper for the common cases: click a “next” control and wait for the page to update Please provide your feedback. Happy to start working on this. |
|
Hi, this can be added easily on the user side via 'LinkExtractor', so we are not planning to add it. The roadmap file is very old and needs an update. |
Uh oh!
There was an error while loading. Please reload this page.
Feature description
Detect common pagination patterns (e.g.
rel="next", “next”/localized link text, numbered pages, query params like?page=) and optionally emit follow-up requests with configurable confidence / overrides.Motivation
Most crawls repeat the same boilerplate; mistakes here waste bandwidth and time.
Proposal (high level)
LinkExtractorlevel; verbose logging when a pattern is chosen.CrawlSpider/LinkExtractor.Related
ROADMAP.md: “Add functionality to automatically detect pagination URLs”Open questions
(I searched existing feature requests for this topic.)
All reactions