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 requestFunction

Ondra Urbanf51fb7bfbe7e
diff --git a/src/cheerio_crawler.js b/src/cheerio_crawler.js
index fb0401333..488fb44ce 100644
--- a/src/cheerio_crawler.js
+++ b/src/cheerio_crawler.js
@@ -339,7 +339,7 @@ class CheerioCrawler {
// Read the body into a string since Cheerio does not support streaming
let body;
try {
- body = await this._readStreamIntoString(stream, cType.encoding);
+ body = await this._readStreamIntoString(res, cType.encoding);
} catch (err) {
// Error in reading the body
return reject(err);