@crawlee/jsdom 4.0.0-beta.9 → 4.0.0-beta.91

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,10 +1,8 @@
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';
7
- import { concatStreamToBuffer } from '@apify/utilities';
8
6
  /**
9
7
  * Provides a framework for the parallel crawling of web pages using plain HTTP requests and
10
8
  * [jsdom](https://www.npmjs.com/package/jsdom) JSDOM implementation.
@@ -27,28 +25,30 @@ import { concatStreamToBuffer } from '@apify/utilities';
27
25
  * and then invokes the user-provided {@link JSDOMCrawlerOptions.requestHandler} to extract page data
28
26
  * using the `window` object.
29
27
  *
30
- * The source URLs are represented using {@link Request} objects that are fed from
31
- * {@link RequestList} or {@link RequestQueue} instances provided by the {@link JSDOMCrawlerOptions.requestList}
32
- * 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`.
33
34
  *
34
- * If both {@link JSDOMCrawlerOptions.requestList} and {@link JSDOMCrawlerOptions.requestQueue} are used,
35
- * the instance first processes URLs from the {@link RequestList} and automatically enqueues all of them
36
- * 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.
37
37
  *
38
38
  * The crawler finishes when there are no more {@link Request} objects to crawl.
39
39
  *
40
- * We can use the `preNavigationHooks` to adjust `gotOptions`:
40
+ * We can use the `preNavigationHooks` to adjust the crawling context before the request is made:
41
41
  *
42
42
  * ```
43
43
  * preNavigationHooks: [
44
- * (crawlingContext, gotOptions) => {
44
+ * (crawlingContext) => {
45
45
  * // ...
46
46
  * },
47
47
  * ]
48
48
  * ```
49
49
  *
50
- * By default, `JSDOMCrawler` only processes web pages with the `text/html`
51
- * 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),
52
52
  * and skips pages with other content types. If you want the crawler to process other content types,
53
53
  * use the {@link JSDOMCrawlerOptions.additionalMimeTypes} constructor option.
54
54
  * Beware that the parsing behavior differs for HTML, XML, JSON and other types of content.
@@ -56,9 +56,9 @@ import { concatStreamToBuffer } from '@apify/utilities';
56
56
  *
57
57
  * New requests are only dispatched when there is enough free CPU and memory available,
58
58
  * using the functionality provided by the {@link AutoscaledPool} class.
59
- * All {@link AutoscaledPool} configuration options can be passed to the `autoscaledPoolOptions`
60
- * parameter of the `CheerioCrawler` constructor. For user convenience, the `minConcurrency` and `maxConcurrency`
61
- * {@link AutoscaledPool} options are available directly in the `CheerioCrawler` constructor.
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`}.
62
62
  *
63
63
  * **Example usage:**
64
64
  *
@@ -92,12 +92,27 @@ export class JSDOMCrawler extends HttpCrawler {
92
92
  runScripts;
93
93
  hideInternalConsole;
94
94
  virtualConsole = null;
95
- constructor(options = {}, config) {
96
- const { runScripts = false, hideInternalConsole = false, ...httpOptions } = options;
97
- super(httpOptions, config);
95
+ constructor(options = {}) {
96
+ const { runScripts = false, hideInternalConsole = false, contextPipelineBuilder, ...httpOptions } = options;
97
+ super({
98
+ ...httpOptions,
99
+ contextPipelineBuilder: contextPipelineBuilder ?? (() => this.buildContextPipeline()),
100
+ });
98
101
  this.runScripts = runScripts;
99
102
  this.hideInternalConsole = hideInternalConsole;
100
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) });
115
+ }
101
116
  /**
102
117
  * Returns the currently used `VirtualConsole` instance. Can be used to listen for the JSDOM's internal console messages.
103
118
  *
@@ -123,117 +138,150 @@ export class JSDOMCrawler extends HttpCrawler {
123
138
  this.virtualConsole.on('jsdomError', this.jsdomErrorHandler);
124
139
  return this.virtualConsole;
125
140
  }
126
- jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', error);
127
- async _cleanupContext(context) {
128
- this.getVirtualConsole().off('jsdomError', this.jsdomErrorHandler);
129
- context.window?.close();
130
- }
131
- async _parseHTML(response, isXml, crawlingContext) {
132
- const body = await concatStreamToBuffer(response);
133
- const { window } = new JSDOM(body, {
134
- url: response.url,
135
- contentType: isXml ? 'text/xml' : 'text/html',
136
- runScripts: this.runScripts ? 'dangerously' : undefined,
137
- resources,
138
- virtualConsole: this.getVirtualConsole(),
139
- pretendToBeVisual: true,
140
- });
141
- // add some stubs in place of missing API so processing won't fail
142
- Object.defineProperty(window, 'matchMedia', {
143
- writable: true,
144
- value: (query) => ({
145
- matches: false,
146
- media: query,
147
- onchange: null,
148
- addListener: () => { },
149
- removeListener: () => { },
150
- addEventListener: () => { },
151
- removeEventListener: () => { },
152
- dispatchEvent: () => { },
153
- }),
154
- });
155
- window.document.createRange = () => {
156
- const range = new window.Range();
157
- range.getBoundingClientRect = () => ({});
158
- range.getClientRects = () => ({ item: () => null, length: 0 });
159
- return range;
160
- };
161
- if (this.runScripts) {
162
- try {
163
- await addTimeoutToPromise(async () => {
164
- return new Promise((resolve) => {
165
- window.addEventListener('load', () => {
166
- resolve();
167
- }, false);
168
- }).catch();
169
- }, 10_000, 'Window.load event not fired after 10 seconds.').catch();
141
+ jsdomErrorHandler = (error) => this.log.debug('JSDOM error from console', { error });
142
+ async parseContent(crawlingContext) {
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
+ }
170
187
  }
171
- catch (e) {
172
- 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
+ };
173
211
  }
212
+ throw err;
174
213
  }
214
+ }
215
+ async addHelpers(crawlingContext) {
175
216
  return {
176
- window,
177
- get body() {
178
- return window.document.documentElement.outerHTML;
179
- },
180
- get document() {
181
- return window.document;
182
- },
183
217
  enqueueLinks: async (enqueueOptions) => {
184
218
  return domCrawlerEnqueueLinks({
185
- options: enqueueOptions,
186
- window,
187
- requestQueue: await this.getRequestQueue(),
219
+ options: {
220
+ ...enqueueOptions,
221
+ limit: await this.calculateEnqueuedRequestLimit(enqueueOptions?.limit),
222
+ },
223
+ window: crawlingContext.window,
224
+ requestManager: await this.getRequestManager(),
188
225
  robotsTxtFile: await this.getRobotsTxtFileForUrl(crawlingContext.request.url),
189
- onSkippedRequest: this.onSkippedRequest,
226
+ onSkippedRequest: this.handleSkippedRequest,
190
227
  originalRequestUrl: crawlingContext.request.url,
191
228
  finalRequestUrl: crawlingContext.request.loadedUrl,
192
229
  });
193
230
  },
194
- };
195
- }
196
- async _runRequestHandler(context) {
197
- context.waitForSelector = async (selector, timeoutMs = 5_000) => {
198
- const $ = cheerio.load(context.body);
199
- if ($(selector).get().length === 0) {
200
- if (timeoutMs) {
201
- await sleep(50);
202
- await context.waitForSelector(selector, Math.max(timeoutMs - 50, 0));
203
- return;
231
+ async waitForSelector(selector, timeoutMs = 5_000) {
232
+ const cheerio = await import('cheerio');
233
+ const $ = cheerio.load(crawlingContext.body);
234
+ if ($(selector).get().length === 0) {
235
+ if (timeoutMs) {
236
+ await sleep(50);
237
+ await this.waitForSelector(selector, Math.max(timeoutMs - 50, 0));
238
+ return;
239
+ }
240
+ throw new Error(`Selector '${selector}' not found.`);
204
241
  }
205
- throw new Error(`Selector '${selector}' not found.`);
206
- }
207
- };
208
- context.parseWithCheerio = async (selector, _timeoutMs = 5_000) => {
209
- const $ = cheerio.load(context.body);
210
- if (selector && $(selector).get().length === 0) {
211
- throw new Error(`Selector '${selector}' not found.`);
212
- }
213
- return $;
242
+ },
243
+ async parseWithCheerio(selector, _timeoutMs = 5_000) {
244
+ const cheerio = await import('cheerio');
245
+ const $ = cheerio.load(crawlingContext.body);
246
+ if (selector && $(selector).get().length === 0) {
247
+ throw new Error(`Selector '${selector}' not found.`);
248
+ }
249
+ return $;
250
+ },
214
251
  };
215
- await super._runRequestHandler(context);
216
252
  }
217
253
  }
218
254
  /** @internal */
219
- 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;
220
261
  if (!window) {
221
262
  throw new Error('Cannot enqueue links because the JSDOM is not available.');
222
263
  }
223
264
  const baseUrl = resolveBaseUrlForEnqueueLinksFiltering({
224
- enqueueStrategy: options?.strategy,
265
+ enqueueStrategy: enqueueLinksOptions?.strategy,
225
266
  finalRequestUrl,
226
267
  originalRequestUrl,
227
- userProvidedBaseUrl: options?.baseUrl,
268
+ userProvidedBaseUrl: enqueueLinksOptions?.baseUrl,
228
269
  });
229
- 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
+ }
230
278
  return enqueueLinks({
231
- requestQueue,
232
- robotsTxtFile,
233
- onSkippedRequest,
279
+ requestManager: options.requestManager,
280
+ robotsTxtFile: options.robotsTxtFile,
281
+ onSkippedRequest: options.onSkippedRequest,
234
282
  urls,
235
283
  baseUrl,
236
- ...options,
284
+ ...enqueueLinksOptions,
237
285
  });
238
286
  }
239
287
  /**
@@ -252,31 +300,6 @@ function extractUrlsFromWindow(window, selector, baseUrl) {
252
300
  })
253
301
  .filter((href) => href !== undefined && href !== '');
254
302
  }
255
- /**
256
- * Creates new {@link Router} instance that works based on request labels.
257
- * This instance can then serve as a `requestHandler` of your {@link JSDOMCrawler}.
258
- * Defaults to the {@link JSDOMCrawlingContext}.
259
- *
260
- * > Serves as a shortcut for using `Router.create<JSDOMCrawlingContext>()`.
261
- *
262
- * ```ts
263
- * import { JSDOMCrawler, createJSDOMRouter } from 'crawlee';
264
- *
265
- * const router = createJSDOMRouter();
266
- * router.addHandler('label-a', async (ctx) => {
267
- * ctx.log.info('...');
268
- * });
269
- * router.addDefaultHandler(async (ctx) => {
270
- * ctx.log.info('...');
271
- * });
272
- *
273
- * const crawler = new JSDOMCrawler({
274
- * requestHandler: router,
275
- * });
276
- * await crawler.run();
277
- * ```
278
- */
279
- export function createJSDOMRouter(routes) {
280
- return Router.create(routes);
303
+ export function createJSDOMRouter(routesOrSchemas) {
304
+ return Router.create(routesOrSchemas);
281
305
  }
282
- //# 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.9",
3
+ "version": "4.0.0-beta.91",
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.9",
53
- "@crawlee/types": "4.0.0-beta.9",
54
- "@crawlee/utils": "4.0.0-beta.9",
50
+ "@apify/timeout": "^0.3.0",
51
+ "@apify/utilities": "^2.7.10",
52
+ "@crawlee/http": "4.0.0-beta.91",
53
+ "@crawlee/types": "4.0.0-beta.91",
54
+ "@crawlee/utils": "4.0.0-beta.91",
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": "d2489f2800cd7d9f15815fc6b5e195dc243703d2"
68
+ "gitHead": "1e3e1ca10f24be53e1d527b3ea25f456baebecbf"
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,cA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