Skip to content

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.

fix: make `crawler.log` publicly accessible (#2526)

Martin Adámek3e9e6652c0b5
diff --git a/packages/basic-crawler/src/internals/basic-crawler.ts b/packages/basic-crawler/src/internals/basic-crawler.ts
index 1cd5cefa6..70322ab2b 100644
--- a/packages/basic-crawler/src/internals/basic-crawler.ts
+++ b/packages/basic-crawler/src/internals/basic-crawler.ts
@@ -477,7 +477,7 @@ export class BasicCrawler<Context extends CrawlingContext = BasicCrawlingContext
running = false;
hasFinishedBefore = false;
- protected log: Log;
+ readonly log: Log;
protected requestHandler!: RequestHandler<Context>;
protected errorHandler?: ErrorHandler<Context>;
protected failedRequestHandler?: ErrorHandler<Context>;
diff --git a/packages/http-crawler/src/internals/http-crawler.ts b/packages/http-crawler/src/internals/http-crawler.ts
index 0f7ca2d1a..114bb849c 100644
--- a/packages/http-crawler/src/internals/http-crawler.ts
+++ b/packages/http-crawler/src/internals/http-crawler.ts
@@ -694,6 +694,7 @@ export class HttpCrawler<
gotOptions,
}: RequestFunctionOptions): Promise<PlainResponse> {
if (!TimeoutError) {
+ // @ts-ignore
({ TimeoutError } = await import('got-scraping'));
}