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: ensure failed req count is correct when using `RequestList` (#1347)

Ondra Urban80905094ad28
diff --git a/src/crawlers/basic_crawler.js b/src/crawlers/basic_crawler.js
index ea31e71bb..b40b60c2f 100644
--- a/src/crawlers/basic_crawler.js
+++ b/src/crawlers/basic_crawler.js
@@ -645,7 +645,7 @@ export class BasicCrawler {
// Mark the request as failed and do not retry.
this.handledRequestsCount++;
await source.markRequestHandled(request);
- this.stats.failJob(request.id || request.url);
+ this.stats.failJob(request.id || request.uniqueKey);
crawlingContext.error = error;
await this._handleFailedRequestFunction(crawlingContext); // This function prints an error message.
}