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.

Added response stream destroy.

Petr Pateke966a7ae7fe6
diff --git a/src/utils_request.js b/src/utils_request.js
index 77dc3928e..bfd2569c0 100644
--- a/src/utils_request.js
+++ b/src/utils_request.js
@@ -121,6 +121,7 @@ export const requestBetter = async (options) => {
const shouldAbort = abortFunction(res);
if (shouldAbort) {
request.abort();
+ res.destroy();
}
// No need to catch invalid content header - it is already caught by request