PaginationConfig · Node.js
Choose how a crawler discovers the next page.
In this guide
Purpose and lifecycle
Use the named factories rather than calling the constructor. Attach the returned configuration with Crawl.withPagination/with_pagination.
Set crawl limits even when pagination has its own maximum. A URL pattern is not evidence that every generated page exists.
Definition and availability
Source snapshot: 1.0.0-alpha.3. Package export. Declared in source; this is not a runtime test result.
Signatures and source locations are generated from the SDK wrappers. Clean snapshots link to the recorded commit. Modified snapshots link to main, which may differ; file hashes identify the local inputs.
export class PaginationConfigUsage example
Use a matching source build. Where a snippet uses page, obtain it with the Page example first. Example URLs illustrate API shape; they are not promised datasets.
import { Crawl, PaginationConfig } from 'crawlingo';
const crawl = new Crawl('https://example.com/catalog?page=1')
.withPagination(PaginationConfig.pageNumber('https://example.com/catalog?page={page}', 1, 5))
.limit(5).field('title', 'h1');Members
| Member | Kind | Return / value type | Source status |
|---|---|---|---|
| inner | property | JsPaginationConfig | Present in source |
| nextLink | static method | PaginationConfig | Present in source |
| pageNumber | static method | PaginationConfig | Present in source |
| urlPattern | static method | PaginationConfig | Present in source |
inner
Native interop handle. Prefer the documented wrapper methods; bypassing them can bypass validation and typed error conversion.
Returns / value: JsPaginationConfig.
public readonly inner: JsPaginationConfig;nextLink()
Use the href of the next-link selector.
Returns / value: PaginationConfig.
nextLink(selector: string): PaginationConfig| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| selector | string | Required | Selector evaluated against the fetched DOM. |
pageNumber()
Construct numbered URLs from a template containing {page}, starting at startPage/start_page and bounded by maxPages/max_pages.
Returns / value: PaginationConfig.
pageNumber(urlTemplate: string, startPage: number, maxPages: number): PaginationConfig| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| urlTemplate | string | Required | URL template containing the literal {page} placeholder. |
| startPage | number | Required | First page number used by numbered pagination. |
| maxPages | number | Required | Numbered-pagination bound passed to the native configuration. |
urlPattern()
Increment the page number captured by a regular expression in the current URL; stop at the configured maximum.
Returns / value: PaginationConfig.
urlPattern(pageRegex: string, maxPage: number): PaginationConfig| Parameter | Type | Required / default | Meaning |
|---|---|---|---|
| pageRegex | string | Required | Regular expression capturing the current page number in a URL. |
| maxPage | number | Required | Upper page-number bound for pattern pagination. |
Errors and operational limits
Invalid patterns or templates can fail when evaluated by the crawler. Validate a small URL sequence before a larger crawl.
Source availability, package publication and runtime validation are separate facts. These pages describe the source snapshot, not a claim that all platforms or every API path have passed production acceptance.