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.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Fix requests hanging with interception enabled
Ondra Urban73b8654ba6f2
diff --git a/src/puppeteer_request_interception.js b/src/puppeteer_request_interception.jsindex 455d670b8..19be7ac76 100644--- a/src/puppeteer_request_interception.js+++ b/src/puppeteer_request_interception.js@@ -201,7 +201,7 @@ export const removeInterceptRequestHandler = async (page, handler) => {pageInterceptRequestHandlersMap.set(page, handlersArray);- if (handlersArray.size === 0) {+ if (handlersArray.length === 0) {const interceptedRequestsInProgress = pageInterceptedRequestsMap.get(page);// Since handlers can be async, we can't simply turn off request interception// when there are no handlers, because some handlers could still@@ -212,10 +212,10 @@ export const removeInterceptRequestHandler = async (page, handler) => {const onDelete = () => {if (interceptedRequestsInProgress.size === 0) {disableRequestInterception(page);+ interceptedRequestsInProgress.removeListener('delete', onDelete);}};interceptedRequestsInProgress.on('delete', onDelete);- interceptedRequestsInProgress.removeListener('delete', onDelete);}}};