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.

refactor: tweak jsdom settings a bit 2

Martin Adámek6b28e8eff4b4
diff --git a/packages/jsdom-crawler/src/internals/jsdom-crawler.ts b/packages/jsdom-crawler/src/internals/jsdom-crawler.ts
index c22713662..f30067d6f 100644
--- a/packages/jsdom-crawler/src/internals/jsdom-crawler.ts
+++ b/packages/jsdom-crawler/src/internals/jsdom-crawler.ts
@@ -235,7 +235,7 @@ export class JSDOMCrawler extends HttpCrawler<JSDOMCrawlingContext> {
window.document.createRange = () => {
const range = new Range();
range.getBoundingClientRect = () => ({} as any);
- range.getClientRects = () => ({ item: () => null, length: 0 }) as any;
+ range.getClientRects = () => ({ item: () => null as any, length: 0 }) as any;
return range;
};