@crawlee/jsdom 4.0.0-beta.13 → 4.0.0-beta.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
- import { enqueueLinks, HttpCrawler, resolveBaseUrlForEnqueueLinksFiltering, Router, tryAbsoluteURL, } from '@crawlee/http';
1
+ import { EnqueueStrategy, HttpCrawler, NavigationSkippedError, parseArgument, resolveBaseUrlForEnqueueLinksFiltering, Router, tryAbsoluteURL, } from '@crawlee/http';
2
2
  import { sleep } from '@crawlee/utils';
3
- import * as cheerio from 'cheerio';
4
3
  import { JSDOM, ResourceLoader, VirtualConsole } from 'jsdom';
5
- import ow from 'ow';
4
+ import { z } from 'zod';
6
5
  import { addTimeoutToPromise } from '@apify/timeout';
7
6
  /**
8
7
  * Provides a framework for the parallel crawling of web pages using plain HTTP requests and
@@ -26,38 +25,40 @@ import { addTimeoutToPromise } from '@apify/timeout';
26
25
  * and then invokes the user-provided {@link JSDOMCrawlerOptions.requestHandler} to extract page data
27
26
  * using the `window` object.
28
27
  *
29
- * The source URLs are represented using {@link Request} objects that are fed from
30
- * {@link RequestList} or {@link RequestQueue} instances provided by the {@link JSDOMCrawlerOptions.requestList}
31
- * or {@link JSDOMCrawlerOptions.requestQueue} constructor options, respectively.
28
+ * The source URLs are represented using {@link Request} objects that are fed from the
29
+ * {@link IRequestManager|request manager} provided via the {@link JSDOMCrawlerOptions.requestManager|`requestManager`}
30
+ * constructor option (a {@link RequestQueue} is itself a request manager). To read from a read-only source such
31
+ * as a {@link RequestList} while still being able to enqueue new requests, combine it with a queue into a
32
+ * {@link RequestManagerTandem} via {@link IRequestLoader.toTandem|`requestLoader.toTandem()`} and pass the
33
+ * result as `requestManager`.
32
34
  *
33
- * If both {@link JSDOMCrawlerOptions.requestList} and {@link JSDOMCrawlerOptions.requestQueue} are used,
34
- * the instance first processes URLs from the {@link RequestList} and automatically enqueues all of them
35
- * to {@link RequestQueue} before it starts their processing. This ensures that a single URL is not crawled multiple times.
35
+ * > The {@link JSDOMCrawlerOptions.requestList|`requestList`} and {@link JSDOMCrawlerOptions.requestQueue|`requestQueue`}
36
+ * > options are deprecated; they are still accepted and folded into a single `requestManager` for back-compat.
36
37
  *
37
38
  * The crawler finishes when there are no more {@link Request} objects to crawl.
38
39
  *
39
- * We can use the `preNavigationHooks` to adjust `gotOptions`:
40
+ * We can use the `preNavigationHooks` to adjust the crawling context before the request is made:
40
41
  *
41
42
  * ```
42
43
  * preNavigationHooks: [
43
- * (crawlingContext, gotOptions) => {
44
+ * (crawlingContext) => {
44
45
  * // ...
45
46
  * },
46
47
  * ]
47
48
  * ```
48
49
  *
49
- * By default, `JSDOMCrawler` only processes web pages with the `text/html`
50
- * and `application/xhtml+xml` MIME content types (as reported by the `Content-Type` HTTP header),
50
+ * By default, `JSDOMCrawler` only processes web pages with the `text/html`, `application/xhtml+xml`, `text/xml`, `application/xml`,
51
+ * and `application/json` MIME content types (as reported by the `Content-Type` HTTP header),
51
52
  * and skips pages with other content types. If you want the crawler to process other content types,
52
53
  * use the {@link JSDOMCrawlerOptions.additionalMimeTypes} constructor option.
53
54
  * Beware that the parsing behavior differs for HTML, XML, JSON and other types of content.
54
55
  * For more details, see {@link JSDOMCrawlerOptions.requestHandler}.
55
56
  *
56
- * New requests are only dispatched when there is enough free CPU and memory available,
57
- * using the functionality provided by the {@link AutoscaledPool} class.
58
- * All {@link AutoscaledPool} configuration options can be passed to the `autoscaledPoolOptions`
59
- * parameter of the `CheerioCrawler` constructor. For user convenience, the `minConcurrency` and `maxConcurrency`
60
- * {@link AutoscaledPool} options are available directly in the `CheerioCrawler` constructor.
57
+ * New requests are only dispatched when there is enough free CPU and memory available, as judged by the crawler's
58
+ * {@link ConcurrencySystem}.
59
+ * Concurrency is tuned via the `minConcurrency`, `maxConcurrency` and `maxRequestsPerMinute` options of the
60
+ * `JSDOMCrawler` constructor, or, for finer control, by injecting a pre-configured
61
+ * {@link ConcurrencySystem|`concurrencySystem`}.
61
62
  *
62
63
  * **Example usage:**
63
64
  *
@@ -85,28 +86,33 @@ const resources = new ResourceLoader({
85
86
  export class JSDOMCrawler extends HttpCrawler {
86
87
  static optionsShape = {
87
88
  ...HttpCrawler.optionsShape,
88
- runScripts: ow.optional.boolean,
89
- hideInternalConsole: ow.optional.boolean,
89
+ runScripts: z.boolean().optional(),
90
+ hideInternalConsole: z.boolean().optional(),
90
91
  };
91
- runScripts;
92
- hideInternalConsole;
93
- virtualConsole = null;
94
- constructor(options = {}, config) {
95
- const { runScripts = false, hideInternalConsole = false, ...httpOptions } = options;
92
+ static optionsSchema = z.strictObject(JSDOMCrawler.optionsShape);
93
+ #runScripts;
94
+ #hideInternalConsole;
95
+ #virtualConsole = null;
96
+ constructor(options = {}) {
97
+ const { runScripts = false, hideInternalConsole = false, contextPipelineBuilder, ...httpOptions } = parseArgument(options, JSDOMCrawler.optionsSchema, 'JSDOMCrawlerOptions');
96
98
  super({
97
99
  ...httpOptions,
98
- contextPipelineBuilder: () => this.buildContextPipeline()
99
- .compose({
100
- action: async (context) => await this.parseContent(context),
101
- cleanup: async (context) => {
102
- this.getVirtualConsole().off('jsdomError', this.jsdomErrorHandler);
103
- context.window?.close();
104
- },
105
- })
106
- .compose({ action: async (context) => await this.addHelpers(context) }),
107
- }, config);
108
- this.runScripts = runScripts;
109
- this.hideInternalConsole = hideInternalConsole;
100
+ contextPipelineBuilder: contextPipelineBuilder ?? (() => this.buildContextPipeline()),
101
+ });
102
+ this.#runScripts = runScripts;
103
+ this.#hideInternalConsole = hideInternalConsole;
104
+ }
105
+ buildContextPipeline() {
106
+ return super
107
+ .buildContextPipeline()
108
+ .compose({
109
+ action: async (context) => await this.parseContent(context),
110
+ cleanup: async (context) => {
111
+ this.getVirtualConsole().off('jsdomError', this.jsdomErrorHandler);
112
+ context.window?.close();
113
+ },
114
+ })
115
+ .compose({ action: async (context) => await this.addHelpers(context) });
110
116
  }
111
117
  /**
112
118
  * Returns the currently used `VirtualConsole` instance. Can be used to listen for the JSDOM's internal console messages.
@@ -123,86 +129,116 @@ export class JSDOMCrawler extends HttpCrawler {
123
129
  * ```
124
130
  */
125
131
  getVirtualConsole() {
126
- if (this.virtualConsole) {
127
- return this.virtualConsole;
132
+ if (this.#virtualConsole) {
133
+ return this.#virtualConsole;
128
134
  }
129
- this.virtualConsole = new VirtualConsole();
130
- if (!this.hideInternalConsole) {
131
- this.virtualConsole.sendTo(console, { omitJSDOMErrors: true });
135
+ this.#virtualConsole = new VirtualConsole();
136
+ if (!this.#hideInternalConsole) {
137
+ this.#virtualConsole.sendTo(console, { omitJSDOMErrors: true });
132
138
  }
133
- this.virtualConsole.on('jsdomError', this.jsdomErrorHandler);
134
- return this.virtualConsole;
139
+ this.#virtualConsole.on('jsdomError', this.jsdomErrorHandler);
140
+ return this.#virtualConsole;
135
141
  }
136
- jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', error);
142
+ jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', { error });
137
143
  async parseContent(crawlingContext) {
138
- const isXml = crawlingContext.contentType.type.includes('xml');
139
- // TODO handle non-string
140
- const { window } = new JSDOM(crawlingContext.body.toString(), {
141
- url: crawlingContext.response.url,
142
- contentType: isXml ? 'text/xml' : 'text/html',
143
- runScripts: this.runScripts ? 'dangerously' : undefined,
144
- resources,
145
- virtualConsole: this.getVirtualConsole(),
146
- pretendToBeVisual: true,
147
- });
148
- // add some stubs in place of missing API so processing won't fail
149
- Object.defineProperty(window, 'matchMedia', {
150
- writable: true,
151
- value: (query) => ({
152
- matches: false,
153
- media: query,
154
- onchange: null,
155
- addListener: () => { },
156
- removeListener: () => { },
157
- addEventListener: () => { },
158
- removeEventListener: () => { },
159
- dispatchEvent: () => { },
160
- }),
161
- });
162
- window.document.createRange = () => {
163
- const range = new window.Range();
164
- range.getBoundingClientRect = () => ({});
165
- range.getClientRects = () => ({ item: () => null, length: 0 });
166
- return range;
167
- };
168
- if (this.runScripts) {
169
- try {
170
- await addTimeoutToPromise(async () => {
171
- return new Promise((resolve) => {
172
- window.addEventListener('load', () => {
173
- resolve();
174
- }, false);
175
- }).catch();
176
- }, 10_000, 'Window.load event not fired after 10 seconds.').catch();
144
+ try {
145
+ const isXml = crawlingContext.contentType.type.includes('xml');
146
+ // TODO handle non-string
147
+ const { window } = new JSDOM(crawlingContext.body.toString(), {
148
+ url: crawlingContext.response.url,
149
+ contentType: isXml ? 'text/xml' : 'text/html',
150
+ runScripts: this.#runScripts ? 'dangerously' : undefined,
151
+ resources,
152
+ virtualConsole: this.getVirtualConsole(),
153
+ pretendToBeVisual: true,
154
+ });
155
+ // add some stubs in place of missing API so processing won't fail
156
+ Object.defineProperty(window, 'matchMedia', {
157
+ writable: true,
158
+ value: (query) => ({
159
+ matches: false,
160
+ media: query,
161
+ onchange: null,
162
+ addListener: () => { },
163
+ removeListener: () => { },
164
+ addEventListener: () => { },
165
+ removeEventListener: () => { },
166
+ dispatchEvent: () => { },
167
+ }),
168
+ });
169
+ window.document.createRange = () => {
170
+ const range = new window.Range();
171
+ range.getBoundingClientRect = () => ({});
172
+ range.getClientRects = () => ({ item: () => null, length: 0 });
173
+ return range;
174
+ };
175
+ if (this.#runScripts) {
176
+ try {
177
+ await addTimeoutToPromise(async () => {
178
+ return new Promise((resolve) => {
179
+ window.addEventListener('load', () => {
180
+ resolve();
181
+ }, false);
182
+ }).catch();
183
+ }, 10_000, 'Window.load event not fired after 10 seconds.').catch();
184
+ }
185
+ catch (e) {
186
+ this.log.debug(e.message);
187
+ }
177
188
  }
178
- catch (e) {
179
- this.log.debug(e.message);
189
+ return {
190
+ window,
191
+ get body() {
192
+ return window.document.documentElement.outerHTML;
193
+ },
194
+ get document() {
195
+ return window.document;
196
+ },
197
+ };
198
+ }
199
+ catch (err) {
200
+ if (err instanceof NavigationSkippedError) {
201
+ return {
202
+ get window() {
203
+ throw new NavigationSkippedError('The `window` property is not available - `skipNavigation` was used', { cause: err });
204
+ },
205
+ get body() {
206
+ throw new NavigationSkippedError('The `body` property is not available - `skipNavigation` was used', { cause: err });
207
+ },
208
+ get document() {
209
+ throw new NavigationSkippedError('The `document` property is not available - `skipNavigation` was used', { cause: err });
210
+ },
211
+ };
180
212
  }
213
+ throw err;
181
214
  }
182
- return {
183
- window,
184
- get body() {
185
- return window.document.documentElement.outerHTML;
186
- },
187
- get document() {
188
- return window.document;
189
- },
190
- };
191
215
  }
192
216
  async addHelpers(crawlingContext) {
217
+ const addRequests = crawlingContext.addRequests;
218
+ const extractLinks = async (options) => {
219
+ if (!crawlingContext.window) {
220
+ throw new Error('Cannot extract links because the JSDOM is not available.');
221
+ }
222
+ return extractUrlsFromWindow(crawlingContext.window, options?.selector ?? 'a', options?.baseUrl ?? crawlingContext.request.loadedUrl ?? crawlingContext.request.url);
223
+ };
193
224
  return {
194
- enqueueLinks: async (enqueueOptions) => {
195
- return domCrawlerEnqueueLinks({
196
- options: enqueueOptions,
197
- window: crawlingContext.window,
198
- requestQueue: await this.getRequestQueue(),
199
- robotsTxtFile: await this.getRobotsTxtFileForUrl(crawlingContext.request.url),
200
- onSkippedRequest: this.onSkippedRequest,
201
- originalRequestUrl: crawlingContext.request.url,
225
+ extractLinks,
226
+ enqueueLinks: async (options = {}) => {
227
+ const baseUrl = resolveBaseUrlForEnqueueLinksFiltering({
228
+ enqueueStrategy: options.strategy,
202
229
  finalRequestUrl: crawlingContext.request.loadedUrl,
230
+ originalRequestUrl: crawlingContext.request.url,
231
+ userProvidedBaseUrl: options.baseUrl,
232
+ });
233
+ const urls = await extractLinks(options);
234
+ return addRequests(urls, {
235
+ ...options,
236
+ baseUrl,
237
+ strategy: options.strategy ?? EnqueueStrategy.SameHostname,
203
238
  });
204
239
  },
205
240
  async waitForSelector(selector, timeoutMs = 5_000) {
241
+ const cheerio = await import('cheerio');
206
242
  const $ = cheerio.load(crawlingContext.body);
207
243
  if ($(selector).get().length === 0) {
208
244
  if (timeoutMs) {
@@ -214,6 +250,7 @@ export class JSDOMCrawler extends HttpCrawler {
214
250
  }
215
251
  },
216
252
  async parseWithCheerio(selector, _timeoutMs = 5_000) {
253
+ const cheerio = await import('cheerio');
217
254
  const $ = cheerio.load(crawlingContext.body);
218
255
  if (selector && $(selector).get().length === 0) {
219
256
  throw new Error(`Selector '${selector}' not found.`);
@@ -223,27 +260,6 @@ export class JSDOMCrawler extends HttpCrawler {
223
260
  };
224
261
  }
225
262
  }
226
- /** @internal */
227
- export async function domCrawlerEnqueueLinks({ options, window, requestQueue, robotsTxtFile, onSkippedRequest, originalRequestUrl, finalRequestUrl, }) {
228
- if (!window) {
229
- throw new Error('Cannot enqueue links because the JSDOM is not available.');
230
- }
231
- const baseUrl = resolveBaseUrlForEnqueueLinksFiltering({
232
- enqueueStrategy: options?.strategy,
233
- finalRequestUrl,
234
- originalRequestUrl,
235
- userProvidedBaseUrl: options?.baseUrl,
236
- });
237
- const urls = extractUrlsFromWindow(window, options?.selector ?? 'a', options?.baseUrl ?? finalRequestUrl ?? originalRequestUrl);
238
- return enqueueLinks({
239
- requestQueue,
240
- robotsTxtFile,
241
- onSkippedRequest,
242
- urls,
243
- baseUrl,
244
- ...options,
245
- });
246
- }
247
263
  /**
248
264
  * Extracts URLs from a given Window object.
249
265
  * @ignore
@@ -260,31 +276,6 @@ function extractUrlsFromWindow(window, selector, baseUrl) {
260
276
  })
261
277
  .filter((href) => href !== undefined && href !== '');
262
278
  }
263
- /**
264
- * Creates new {@link Router} instance that works based on request labels.
265
- * This instance can then serve as a `requestHandler` of your {@link JSDOMCrawler}.
266
- * Defaults to the {@link JSDOMCrawlingContext}.
267
- *
268
- * > Serves as a shortcut for using `Router.create<JSDOMCrawlingContext>()`.
269
- *
270
- * ```ts
271
- * import { JSDOMCrawler, createJSDOMRouter } from 'crawlee';
272
- *
273
- * const router = createJSDOMRouter();
274
- * router.addHandler('label-a', async (ctx) => {
275
- * ctx.log.info('...');
276
- * });
277
- * router.addDefaultHandler(async (ctx) => {
278
- * ctx.log.info('...');
279
- * });
280
- *
281
- * const crawler = new JSDOMCrawler({
282
- * requestHandler: router,
283
- * });
284
- * await crawler.run();
285
- * ```
286
- */
287
- export function createJSDOMRouter(routes) {
288
- return Router.create(routes);
279
+ export function createJSDOMRouter(routesOrSchemas) {
280
+ return Router.create(routesOrSchemas);
289
281
  }
290
- //# sourceMappingURL=jsdom-crawler.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/jsdom",
3
- "version": "4.0.0-beta.13",
3
+ "version": "4.0.0-beta.131",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://crawlee.dev",
40
40
  "scripts": {
41
- "build": "yarn clean && yarn compile && yarn copy",
41
+ "build": "pnpm clean && pnpm compile && pnpm copy",
42
42
  "clean": "rimraf ./dist",
43
43
  "compile": "tsc -p tsconfig.build.json",
44
44
  "copy": "tsx ../../scripts/copy.ts"
@@ -47,16 +47,16 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@apify/timeout": "^0.3.2",
51
- "@apify/utilities": "^2.15.5",
52
- "@crawlee/http": "4.0.0-beta.13",
53
- "@crawlee/types": "4.0.0-beta.13",
54
- "@crawlee/utils": "4.0.0-beta.13",
50
+ "@apify/timeout": "^0.4.4",
51
+ "@apify/utilities": "^2.7.10",
52
+ "@crawlee/http": "4.0.0-beta.131",
53
+ "@crawlee/types": "4.0.0-beta.131",
54
+ "@crawlee/utils": "4.0.0-beta.131",
55
55
  "@types/jsdom": "^21.1.7",
56
56
  "cheerio": "^1.0.0",
57
57
  "jsdom": "^26.1.0",
58
- "ow": "^2.0.0",
59
- "tslib": "^2.8.1"
58
+ "tslib": "^2.8.1",
59
+ "zod": "^4.4.3"
60
60
  },
61
61
  "lerna": {
62
62
  "command": {
@@ -65,5 +65,5 @@
65
65
  }
66
66
  }
67
67
  },
68
- "gitHead": "24df7c8dba6b6c9623c02ccc655d8ee748f003e3"
68
+ "gitHead": "de741c0b63d0da061e4ffcd6ce6fdc0c92401399"
69
69
  }
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC"}
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsdom-crawler.d.ts","sourceRoot":"","sources":["../../src/internals/jsdom-crawler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,sBAAsB,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEH,WAAW,EAId,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAS,MAAM,gBAAgB,CAAC;AAE7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAyB,cAAc,EAAE,MAAM,OAAO,CAAC;AAK9D,MAAM,MAAM,iBAAiB,CACzB,QAAQ,SAAS,UAAU,GAAG,GAAG,EAAE,2EAA2E;AAC9G,QAAQ,SAAS,UAAU,GAAG,GAAG,IACjC,YAAY,CAAC,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3D,MAAM,WAAW,mBAAmB,CAChC,eAAe,SAAS,oBAAo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