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.

improved message.

Petr Patekec8553505bbe
diff --git a/src/crawlers/cheerio_crawler.js b/src/crawlers/cheerio_crawler.js
index f2c420291..d109fbc47 100644
--- a/src/crawlers/cheerio_crawler.js
+++ b/src/crawlers/cheerio_crawler.js
@@ -357,7 +357,7 @@ class CheerioCrawler {
const { dom, isXmlOrHtml, body, contentType, responseStream: response } = await addTimeoutToPromise(
this._requestFunction({ request }),
this.requestTimeoutMillis,
- `CheerioCrawler: requestFunction timed out after ${this.requestTimeoutMillis}.`,
+ `CheerioCrawler: request timed out after ${this.requestTimeoutMillis / 1000} seconds.\``,
);
request.loadedUrl = response.url;
@@ -410,7 +410,7 @@ class CheerioCrawler {
responseStream = await requestAsBrowser(opts);
} catch (e) {
if (e instanceof TimeoutError) {
- throw new Error(`CheerioCrawler: requestFunction timed out after ${this.requestTimeoutMillis}.`);
+ throw new Error(`CheerioCrawler: request timed out after ${this.handlePageTimeoutMillis / 1000} seconds.`);
} else {
throw e;
}