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 wrong use of htmlparser

Ondra Urban091fcb12087e
diff --git a/src/crawlers/cheerio_crawler.js b/src/crawlers/cheerio_crawler.js
index 114578888..c5d02b55c 100644
--- a/src/crawlers/cheerio_crawler.js
+++ b/src/crawlers/cheerio_crawler.js
@@ -657,7 +657,7 @@ class CheerioCrawler {
if (err) reject(err);
else resolve(dom);
});
- const parser = new htmlparser.Parser(domHandler, { decodeEntities: true });
+ const parser = new htmlparser.WritableStream(domHandler, { decodeEntities: true });
response.on('error', reject).pipe(parser);
});
}