Skip to main content

Signature

Minimal example

Multi-URL example

Parameter

options: ScrapeOptions - see ScrapeOptions for the full field list. The only required field is urls: string[]. Everything else has sensible defaults.

Return type

Promise<ScrapeResult> - see ScrapeResult for the full shape. Key fields:

Single vs batch behavior

  • Single URL - urls: [oneUrl]. data has one entry.
  • Multiple URLs - urls: [url1, url2, ...]. Set batchConcurrency to control parallelism.
scrape() behaves the same way in both cases - the only difference is the number of URLs and the parallelism. There’s no separate single-URL method.

Error behavior

scrape() does not throw on individual URL failures. Failed URLs are reported in result.batchMetadata.errors, and only successful results appear in result.data. scrape() does throw on:
  • Invalid options (ValidationError)
  • All engines exhausted for a single URL (RetryBudgetExhaustedError)
  • Browser pool exhausted (PoolExhaustedError)
  • Client closed (ClientClosedError)
See Error Handling.

Where to go next

ScrapeOptions

Every option with type and default.

ScrapeResult

The full result type tree.