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
fix(core): use createSessionFunction when loading Session from persisted state (#2444)
Gustavo Silva3c56b4ca1efe
diff --git a/packages/core/src/session_pool/session_pool.ts b/packages/core/src/session_pool/session_pool.tsindex 52e860f4a..78f1ad34e 100644--- a/packages/core/src/session_pool/session_pool.ts+++ b/packages/core/src/session_pool/session_pool.ts@@ -65,7 +65,7 @@ export interface SessionPoolOptions {/*** Control how and when to persist the state of the session pool.*/- persistenceOptions?: PersistenceOptions;+ persistenceOptions?: PersistenceOptions;}/**@@ -472,7 +472,7 @@ export class SessionPool extends EventEmitter {sessionObject.sessionPool = this;sessionObject.createdAt = new Date(sessionObject.createdAt as string);sessionObject.expiresAt = new Date(sessionObject.expiresAt as string);- const recreatedSession = new Session(sessionObject);+ const recreatedSession = await this.createSessionFunction(this, { sessionOptions: sessionObject });if (recreatedSession.isUsable()) {this._addSession(recreatedSession);