@crawlee/jsdom 4.0.0-beta.12 → 4.0.0-beta.121

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,6 +1,5 @@
1
- import { enqueueLinks, HttpCrawler, resolveBaseUrlForEnqueueLinksFiltering, Router, tryAbsoluteURL, } from '@crawlee/http';
1
+ import { enqueueLinks, HttpCrawler, NavigationSkippedError, 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
4
  import ow from 'ow';
6
5
  import { addTimeoutToPromise } from '@apify/timeout';
@@ -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
  *
@@ -88,25 +89,29 @@ export class JSDOMCrawler extends HttpCrawler {
88
89
  runScripts: ow.optional.boolean,
89
90
  hideInternalConsole: ow.optional.boolean,
90
91
  };
91
- runScripts;
92
- hideInternalConsole;
93
- virtualConsole = null;
94
- constructor(options = {}, config) {
95
- const { runScripts = false, hideInternalConsole = false, ...httpOptions } = options;
92
+ #runScripts;
93
+ #hideInternalConsole;
94
+ #virtualConsole = null;
95
+ constructor(options = {}) {
96
+ const { runScripts = false, hideInternalConsole = false, contextPipelineBuilder, ...httpOptions } = options;
96
97
  super({
97
98
  ...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;
99
+ contextPipelineBuilder: contextPipelineBuilder ?? (() => this.buildContextPipeline()),
100
+ });
101
+ this.#runScripts = runScripts;
102
+ this.#hideInternalConsole = hideInternalConsole;
103
+ }
104
+ buildContextPipeline() {
105
+ return super
106
+ .buildContextPipeline()
107
+ .compose({
108
+ action: async (context) => await this.parseContent(context),
109
+ cleanup: async (context) => {
110
+ this.getVirtualConsole().off('jsdomError', this.jsdomErrorHandler);
111
+ context.window?.close();
112
+ },
113
+ })
114
+ .compose({ action: async (context) => await this.addHelpers(context) });
110
115
  }
111
116
  /**
112
117
  * Returns the currently used `VirtualConsole` instance. Can be used to listen for the JSDOM's internal console messages.
@@ -123,86 +128,108 @@ export class JSDOMCrawler extends HttpCrawler {
123
128
  * ```
124
129
  */
125
130
  getVirtualConsole() {
126
- if (this.virtualConsole) {
127
- return this.virtualConsole;
131
+ if (this.#virtualConsole) {
132
+ return this.#virtualConsole;
128
133
  }
129
- this.virtualConsole = new VirtualConsole();
130
- if (!this.hideInternalConsole) {
131
- this.virtualConsole.sendTo(console, { omitJSDOMErrors: true });
134
+ this.#virtualConsole = new VirtualConsole();
135
+ if (!this.#hideInternalConsole) {
136
+ this.#virtualConsole.sendTo(console, { omitJSDOMErrors: true });
132
137
  }
133
- this.virtualConsole.on('jsdomError', this.jsdomErrorHandler);
134
- return this.virtualConsole;
138
+ this.#virtualConsole.on('jsdomError', this.jsdomErrorHandler);
139
+ return this.#virtualConsole;
135
140
  }
136
- jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', error);
141
+ jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', { error });
137
142
  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();
143
+ try {
144
+ const isXml = crawlingContext.contentType.type.includes('xml');
145
+ // TODO handle non-string
146
+ const { window } = new JSDOM(crawlingContext.body.toString(), {
147
+ url: crawlingContext.response.url,
148
+ contentType: isXml ? 'text/xml' : 'text/html',
149
+ runScripts: this.#runScripts ? 'dangerously' : undefined,
150
+ resources,
151
+ virtualConsole: this.getVirtualConsole(),
152
+ pretendToBeVisual: true,
153
+ });
154
+ // add some stubs in place of missing API so processing won't fail
155
+ Object.defineProperty(window, 'matchMedia', {
156
+ writable: true,
157
+ value: (query) => ({
158
+ matches: false,
159
+ media: query,
160
+ onchange: null,
161
+ addListener: () => { },
162
+ removeListener: () => { },
163
+ addEventListener: () => { },
164
+ removeEventListener: () => { },
165
+ dispatchEvent: () => { },
166
+ }),
167
+ });
168
+ window.document.createRange = () => {
169
+ const range = new window.Range();
170
+ range.getBoundingClientRect = () => ({});
171
+ range.getClientRects = () => ({ item: () => null, length: 0 });
172
+ return range;
173
+ };
174
+ if (this.#runScripts) {
175
+ try {
176
+ await addTimeoutToPromise(async () => {
177
+ return new Promise((resolve) => {
178
+ window.addEventListener('load', () => {
179
+ resolve();
180
+ }, false);
181
+ }).catch();
182
+ }, 10_000, 'Window.load event not fired after 10 seconds.').catch();
183
+ }
184
+ catch (e) {
185
+ this.log.debug(e.message);
186
+ }
177
187
  }
178
- catch (e) {
179
- this.log.debug(e.message);
188
+ return {
189
+ window,
190
+ get body() {
191
+ return window.document.documentElement.outerHTML;
192
+ },
193
+ get document() {
194
+ return window.document;
195
+ },
196
+ };
197
+ }
198
+ catch (err) {
199
+ if (err instanceof NavigationSkippedError) {
200
+ return {
201
+ get window() {
202
+ throw new NavigationSkippedError('The `window` property is not available - `skipNavigation` was used', { cause: err });
203
+ },
204
+ get body() {
205
+ throw new NavigationSkippedError('The `body` property is not available - `skipNavigation` was used', { cause: err });
206
+ },
207
+ get document() {
208
+ throw new NavigationSkippedError('The `document` property is not available - `skipNavigation` was used', { cause: err });
209
+ },
210
+ };
180
211
  }
212
+ throw err;
181
213
  }
182
- return {
183
- window,
184
- get body() {
185
- return window.document.documentElement.outerHTML;
186
- },
187
- get document() {
188
- return window.document;
189
- },
190
- };
191
214
  }
192
215
  async addHelpers(crawlingContext) {
193
216
  return {
194
217
  enqueueLinks: async (enqueueOptions) => {
195
- return domCrawlerEnqueueLinks({
196
- options: enqueueOptions,
218
+ return (await domCrawlerEnqueueLinks({
219
+ options: {
220
+ ...enqueueOptions,
221
+ limit: await this.calculateEnqueuedRequestLimit(enqueueOptions?.limit),
222
+ },
197
223
  window: crawlingContext.window,
198
- requestQueue: await this.getRequestQueue(),
224
+ requestManager: await this.getRequestManager(),
199
225
  robotsTxtFile: await this.getRobotsTxtFileForUrl(crawlingContext.request.url),
200
- onSkippedRequest: this.onSkippedRequest,
226
+ onSkippedRequest: this.handleSkippedRequest,
201
227
  originalRequestUrl: crawlingContext.request.url,
202
228
  finalRequestUrl: crawlingContext.request.loadedUrl,
203
- });
229
+ })); // TODO make this type safe, see https://github.com/apify/crawlee/issues/4024
204
230
  },
205
231
  async waitForSelector(selector, timeoutMs = 5_000) {
232
+ const cheerio = await import('cheerio');
206
233
  const $ = cheerio.load(crawlingContext.body);
207
234
  if ($(selector).get().length === 0) {
208
235
  if (timeoutMs) {
@@ -214,6 +241,7 @@ export class JSDOMCrawler extends HttpCrawler {
214
241
  }
215
242
  },
216
243
  async parseWithCheerio(selector, _timeoutMs = 5_000) {
244
+ const cheerio = await import('cheerio');
217
245
  const $ = cheerio.load(crawlingContext.body);
218
246
  if (selector && $(selector).get().length === 0) {
219
247
  throw new Error(`Selector '${selector}' not found.`);
@@ -224,24 +252,36 @@ export class JSDOMCrawler extends HttpCrawler {
224
252
  }
225
253
  }
226
254
  /** @internal */
227
- export async function domCrawlerEnqueueLinks({ options, window, requestQueue, robotsTxtFile, onSkippedRequest, originalRequestUrl, finalRequestUrl, }) {
255
+ function containsEnqueueLinks(options) {
256
+ return !!options.enqueueLinks;
257
+ }
258
+ /** @internal */
259
+ export async function domCrawlerEnqueueLinks(options) {
260
+ const { options: enqueueLinksOptions, window, originalRequestUrl, finalRequestUrl } = options;
228
261
  if (!window) {
229
262
  throw new Error('Cannot enqueue links because the JSDOM is not available.');
230
263
  }
231
264
  const baseUrl = resolveBaseUrlForEnqueueLinksFiltering({
232
- enqueueStrategy: options?.strategy,
265
+ enqueueStrategy: enqueueLinksOptions?.strategy,
233
266
  finalRequestUrl,
234
267
  originalRequestUrl,
235
- userProvidedBaseUrl: options?.baseUrl,
268
+ userProvidedBaseUrl: enqueueLinksOptions?.baseUrl,
236
269
  });
237
- const urls = extractUrlsFromWindow(window, options?.selector ?? 'a', options?.baseUrl ?? finalRequestUrl ?? originalRequestUrl);
270
+ const urls = extractUrlsFromWindow(window, enqueueLinksOptions?.selector ?? 'a', enqueueLinksOptions?.baseUrl ?? finalRequestUrl ?? originalRequestUrl);
271
+ if (containsEnqueueLinks(options)) {
272
+ return options.enqueueLinks({
273
+ urls,
274
+ baseUrl,
275
+ ...enqueueLinksOptions,
276
+ });
277
+ }
238
278
  return enqueueLinks({
239
- requestQueue,
240
- robotsTxtFile,
241
- onSkippedRequest,
279
+ requestManager: options.requestManager,
280
+ robotsTxtFile: options.robotsTxtFile,
281
+ onSkippedRequest: options.onSkippedRequest,
242
282
  urls,
243
283
  baseUrl,
244
- ...options,
284
+ ...enqueueLinksOptions,
245
285
  });
246
286
  }
247
287
  /**
@@ -260,31 +300,6 @@ function extractUrlsFromWindow(window, selector, baseUrl) {
260
300
  })
261
301
  .filter((href) => href !== undefined && href !== '');
262
302
  }
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);
303
+ export function createJSDOMRouter(routesOrSchemas) {
304
+ return Router.create(routesOrSchemas);
289
305
  }
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.12",
3
+ "version": "4.0.0-beta.121",
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,11 +47,11 @@
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.12",
53
- "@crawlee/types": "4.0.0-beta.12",
54
- "@crawlee/utils": "4.0.0-beta.12",
50
+ "@apify/timeout": "^0.4.4",
51
+ "@apify/utilities": "^2.7.10",
52
+ "@crawlee/http": "4.0.0-beta.121",
53
+ "@crawlee/types": "4.0.0-beta.121",
54
+ "@crawlee/utils": "4.0.0-beta.121",
55
55
  "@types/jsdom": "^21.1.7",
56
56
  "cheerio": "^1.0.0",
57
57
  "jsdom": "^26.1.0",
@@ -65,5 +65,5 @@
65
65
  }
66
66
  }
67
67
  },
68
- "gitHead": "06431733e5cfa6cc3a4c105427592f87424037ca"
68
+ "gitHead": "5027317de626f5ba6de5047ae9341a898258cc5a"
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,oBAAoB,GAAG,oBAAoB,EACnE,QAAQ,SAAS,UAAU,GAAG,GAAG,EAAE,2EAA2E;AAC9G,QAAQ,SAAS,UAAU,GAAG,GAAG,CACnC,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC,QAAQ,EAAE,Q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