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
refactor: do not add multiple jsdomError handlers to the virtual console
Martin Adámek222ad7aa0081
diff --git a/packages/jsdom-crawler/src/internals/jsdom-crawler.ts b/packages/jsdom-crawler/src/internals/jsdom-crawler.tsindex 9a4ed0cbc..f0609a5ed 100644--- a/packages/jsdom-crawler/src/internals/jsdom-crawler.ts+++ b/packages/jsdom-crawler/src/internals/jsdom-crawler.ts@@ -184,11 +184,14 @@ export class JSDOMCrawler extends HttpCrawler<JSDOMCrawlingContext> {* ```*/getVirtualConsole() {- if (!this.virtualConsole) {- this.virtualConsole = new VirtualConsole();- if (!this.hideInternalConsole) {- this.virtualConsole.sendTo(console);- }+ if (this.virtualConsole) {+ return this.virtualConsole;+ }++ this.virtualConsole = new VirtualConsole();++ if (!this.hideInternalConsole) {+ this.virtualConsole.sendTo(console);}this.virtualConsole.on('jsdomError', this.jsdomErrorHandler);