Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
docs: `Request.userData` must be serializable (#3327)
Jindřich Bär2037ea9e085c
diff --git a/packages/core/src/request.ts b/packages/core/src/request.tsindex bafc6a1d2..abad31174 100644--- a/packages/core/src/request.ts+++ b/packages/core/src/request.ts@@ -125,7 +125,12 @@ export class Request<UserData extends Dictionary = Dictionary> {/** Private store for the custom user data assigned to the request. */private _userData: Record<string, any> = {};- /** Custom user data assigned to the request. */+ /**+ * Custom user data assigned to the request.+ *+ * All data stored in `userData` must be JSON-serializable.+ * Storing non-serializable values (e.g. functions, symbols) may result in unexpected results.+ */userData: UserData = {} as UserData;/**@@ -486,6 +491,9 @@ export interface RequestOptions<UserData extends Dictionary = Dictionary> {/*** Custom user data assigned to the request. Use this to save any request related data to the* request's scope, keeping them accessible on retries, failures etc.+ *+ * All data stored in `userData` must be JSON-serializable.+ * Storing non-serializable values (e.g. functions, symbols) may result in unexpected results.*/userData?: UserData;