@crawlee/playwright 3.0.5-beta.8 → 3.1.0

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.
@@ -19,9 +19,12 @@
19
19
  */
20
20
  // @ts-ignore optional peer dependency
21
21
  import type { Page, Response } from 'playwright';
22
- import type { Request } from '@crawlee/core';
23
- import type { CheerioRoot } from '@crawlee/utils';
22
+ import type { Request } from '@crawlee/browser';
23
+ import type { CheerioRoot, Dictionary } from '@crawlee/utils';
24
+ import type { BatchAddRequestsResult } from '@crawlee/types';
24
25
  import type { PlaywrightCrawlingContext } from '../playwright-crawler';
26
+ import type { EnqueueLinksByClickingElementsOptions } from '../enqueue-links/click-elements';
27
+ import { enqueueLinksByClickingElements } from '../enqueue-links/click-elements';
25
28
  export interface InjectFileOptions {
26
29
  /**
27
30
  * Enables the injected script to survive page navigations and reloads without need to be re-injected manually.
@@ -157,6 +160,103 @@ export declare function gotoExtended(page: Page, request: Request, gotoOptions?:
157
160
  * @param [options]
158
161
  */
159
162
  export declare function blockRequests(page: Page, options?: BlockRequestsOptions): Promise<void>;
163
+ export interface CompiledScriptParams {
164
+ page: Page;
165
+ request: Request;
166
+ }
167
+ export declare type CompiledScriptFunction = (params: CompiledScriptParams) => Promise<unknown>;
168
+ /**
169
+ * Compiles a Playwright script into an async function that may be executed at any time
170
+ * by providing it with the following object:
171
+ * ```
172
+ * {
173
+ * page: Page,
174
+ * request: Request,
175
+ * }
176
+ * ```
177
+ * Where `page` is a Playwright [`Page`](https://playwright.dev/docs/api/class-page)
178
+ * and `request` is a {@apilink Request}.
179
+ *
180
+ * The function is compiled by using the `scriptString` parameter as the function's body,
181
+ * so any limitations to function bodies apply. Return value of the compiled function
182
+ * is the return value of the function body = the `scriptString` parameter.
183
+ *
184
+ * As a security measure, no globals such as `process` or `require` are accessible
185
+ * from within the function body. Note that the function does not provide a safe
186
+ * sandbox and even though globals are not easily accessible, malicious code may
187
+ * still execute in the main process via prototype manipulation. Therefore you
188
+ * should only use this function to execute sanitized or safe code.
189
+ *
190
+ * Custom context may also be provided using the `context` parameter. To improve security,
191
+ * make sure to only pass the really necessary objects to the context. Preferably making
192
+ * secured copies beforehand.
193
+ */
194
+ export declare function compileScript(scriptString: string, context?: Dictionary): CompiledScriptFunction;
195
+ export interface InfiniteScrollOptions {
196
+ /**
197
+ * How many seconds to scroll for. If 0, will scroll until bottom of page.
198
+ * @default 1
199
+ */
200
+ timeoutSecs?: number;
201
+ /**
202
+ * How many seconds to wait for no new content to load before exit.
203
+ * @default 4
204
+ */
205
+ waitForSecs?: number;
206
+ /**
207
+ * If true, it will scroll up a bit after each scroll down. This is required on some websites for the scroll to work.
208
+ * @default false
209
+ */
210
+ scrollDownAndUp?: boolean;
211
+ /**
212
+ * Optionally checks and clicks a button if it appears while scrolling. This is required on some websites for the scroll to work.
213
+ */
214
+ buttonSelector?: string;
215
+ /**
216
+ * This function is called after every scroll and stops the scrolling process if it returns `true`. The function can be `async`.
217
+ */
218
+ stopScrollCallback?: () => unknown | Promise<unknown>;
219
+ }
220
+ /**
221
+ * Scrolls to the bottom of a page, or until it times out.
222
+ * Loads dynamic content when it hits the bottom of a page, and then continues scrolling.
223
+ * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
224
+ * @param [options]
225
+ */
226
+ export declare function infiniteScroll(page: Page, options?: InfiniteScrollOptions): Promise<void>;
227
+ export interface SaveSnapshotOptions {
228
+ /**
229
+ * Key under which the screenshot and HTML will be saved. `.jpg` will be appended for screenshot and `.html` for HTML.
230
+ * @default 'SNAPSHOT'
231
+ */
232
+ key?: string;
233
+ /**
234
+ * The quality of the image, between 0-100. Higher quality images have bigger size and require more storage.
235
+ * @default 50
236
+ */
237
+ screenshotQuality?: number;
238
+ /**
239
+ * If true, it will save a full screenshot of the current page as a record with `key` appended by `.jpg`.
240
+ * @default true
241
+ */
242
+ saveScreenshot?: boolean;
243
+ /**
244
+ * If true, it will save a full HTML of the current page as a record with `key` appended by `.html`.
245
+ * @default true
246
+ */
247
+ saveHtml?: boolean;
248
+ /**
249
+ * Name or id of the Key-Value store where snapshot is saved. By default it is saved to default Key-Value store.
250
+ * @default null
251
+ */
252
+ keyValueStoreName?: string | null;
253
+ }
254
+ /**
255
+ * Saves a full screenshot and HTML of the current page into a Key-Value store.
256
+ * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
257
+ * @param [options]
258
+ */
259
+ export declare function saveSnapshot(page: Page, options?: SaveSnapshotOptions): Promise<void>;
160
260
  /**
161
261
  * Returns Cheerio handle for `page.content()`, allowing to work with the data same way as with {@apilink CheerioCrawler}.
162
262
  *
@@ -169,19 +269,183 @@ export declare function blockRequests(page: Page, options?: BlockRequestsOptions
169
269
  * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
170
270
  */
171
271
  export declare function parseWithCheerio(page: Page): Promise<CheerioRoot>;
272
+ /** @internal */
172
273
  export interface PlaywrightContextUtils {
274
+ /**
275
+ * Injects a JavaScript file into current `page`.
276
+ * Unlike Playwright's `addScriptTag` function, this function works on pages
277
+ * with arbitrary Cross-Origin Resource Sharing (CORS) policies.
278
+ *
279
+ * File contents are cached for up to 10 files to limit file system access.
280
+ */
173
281
  injectFile(filePath: string, options?: InjectFileOptions): Promise<unknown>;
282
+ /**
283
+ * Injects the [jQuery](https://jquery.com/) library into current `page`.
284
+ * jQuery is often useful for various web scraping and crawling tasks.
285
+ * For example, it can help extract text from HTML elements using CSS selectors.
286
+ *
287
+ * Beware that the injected jQuery object will be set to the `window.$` variable and thus it might cause conflicts with
288
+ * other libraries included by the page that use the same variable name (e.g. another version of jQuery).
289
+ * This can affect functionality of page's scripts.
290
+ *
291
+ * The injected jQuery will survive page navigations and reloads.
292
+ *
293
+ * **Example usage:**
294
+ * ```javascript
295
+ * async requestHandler({ page, injectJQuery }) {
296
+ * await injectJQuery();
297
+ * const title = await page.evaluate(() => {
298
+ * return $('head title').text();
299
+ * });
300
+ * });
301
+ * ```
302
+ *
303
+ * Note that `injectJQuery()` does not affect the Playwright
304
+ * [`page.$()`](https://playwright.dev/docs/api/class-page#page-query-selector)
305
+ * function in any way.
306
+ */
174
307
  injectJQuery(): Promise<unknown>;
308
+ /**
309
+ * Forces the Playwright browser tab to block loading URLs that match a provided pattern.
310
+ * This is useful to speed up crawling of websites, since it reduces the amount
311
+ * of data that needs to be downloaded from the web, but it may break some websites
312
+ * or unexpectedly prevent loading of resources.
313
+ *
314
+ * By default, the function will block all URLs including the following patterns:
315
+ *
316
+ * ```json
317
+ * [".css", ".jpg", ".jpeg", ".png", ".svg", ".gif", ".woff", ".pdf", ".zip"]
318
+ * ```
319
+ *
320
+ * If you want to extend this list further, use the `extraUrlPatterns` option,
321
+ * which will keep blocking the default patterns, as well as add your custom ones.
322
+ * If you would like to block only specific patterns, use the `urlPatterns` option,
323
+ * which will override the defaults and block only URLs with your custom patterns.
324
+ *
325
+ * This function does not use Playwright's request interception and therefore does not interfere
326
+ * with browser cache. It's also faster than blocking requests using interception,
327
+ * because the blocking happens directly in the browser without the round-trip to Node.js,
328
+ * but it does not provide the extra benefits of request interception.
329
+ *
330
+ * The function will never block main document loads and their respective redirects.
331
+ *
332
+ * **Example usage**
333
+ * ```javascript
334
+ * preNavigationHooks: [
335
+ * async ({ blockRequests }) => {
336
+ * // Block all requests to URLs that include `adsbygoogle.js` and also all defaults.
337
+ * await blockRequests({
338
+ * extraUrlPatterns: ['adsbygoogle.js'],
339
+ * }),
340
+ * }),
341
+ * ],
342
+ * ```
343
+ */
175
344
  blockRequests(options?: BlockRequestsOptions): Promise<void>;
345
+ /**
346
+ * Returns Cheerio handle for `page.content()`, allowing to work with the data same way as with {@apilink CheerioCrawler}.
347
+ *
348
+ * **Example usage:**
349
+ * ```javascript
350
+ * async requestHandler({ parseWithCheerio }) {
351
+ * const $ = await parseWithCheerio();
352
+ * const title = $('title').text();
353
+ * });
354
+ * ```
355
+ */
176
356
  parseWithCheerio(): Promise<CheerioRoot>;
357
+ /**
358
+ * Scrolls to the bottom of a page, or until it times out.
359
+ * Loads dynamic content when it hits the bottom of a page, and then continues scrolling.
360
+ */
361
+ infiniteScroll(options?: InfiniteScrollOptions): Promise<void>;
362
+ /**
363
+ * Saves a full screenshot and HTML of the current page into a Key-Value store.
364
+ * @param [options]
365
+ */
366
+ saveSnapshot(options?: SaveSnapshotOptions): Promise<void>;
367
+ /**
368
+ * The function finds elements matching a specific CSS selector in a Playwright page,
369
+ * clicks all those elements using a mouse move and a left mouse button click and intercepts
370
+ * all the navigation requests that are subsequently produced by the page. The intercepted
371
+ * requests, including their methods, headers and payloads are then enqueued to a provided
372
+ * {@apilink RequestQueue}. This is useful to crawl JavaScript heavy pages where links are not available
373
+ * in `href` elements, but rather navigations are triggered in click handlers.
374
+ * If you're looking to find URLs in `href` attributes of the page, see {@apilink enqueueLinks}.
375
+ *
376
+ * Optionally, the function allows you to filter the target links' URLs using an array of {@apilink PseudoUrl} objects
377
+ * and override settings of the enqueued {@apilink Request} objects.
378
+ *
379
+ * **IMPORTANT**: To be able to do this, this function uses various mutations on the page,
380
+ * such as changing the Z-index of elements being clicked and their visibility. Therefore,
381
+ * it is recommended to only use this function as the last operation in the page.
382
+ *
383
+ * **USING HEADFUL BROWSER**: When using a headful browser, this function will only be able to click elements
384
+ * in the focused tab, effectively limiting concurrency to 1. In headless mode, full concurrency can be achieved.
385
+ *
386
+ * **PERFORMANCE**: Clicking elements with a mouse and intercepting requests is not a low level operation
387
+ * that takes nanoseconds. It's not very CPU intensive, but it takes time. We strongly recommend limiting
388
+ * the scope of the clicking as much as possible by using a specific selector that targets only the elements
389
+ * that you assume or know will produce a navigation. You can certainly click everything by using
390
+ * the `*` selector, but be prepared to wait minutes to get results on a large and complex page.
391
+ *
392
+ * **Example usage**
393
+ *
394
+ * ```javascript
395
+ * async requestHandler({ enqueueLinksByClickingElements }) {
396
+ * await enqueueLinksByClickingElements({
397
+ * selector: 'a.product-detail',
398
+ * globs: [
399
+ * 'https://www.example.com/handbags/**'
400
+ * 'https://www.example.com/purses/**'
401
+ * ],
402
+ * });
403
+ * });
404
+ * ```
405
+ *
406
+ * @returns Promise that resolves to {@apilink BatchAddRequestsResult} object.
407
+ */
408
+ enqueueLinksByClickingElements(options: Omit<EnqueueLinksByClickingElementsOptions, 'page' | 'requestQueue'>): Promise<BatchAddRequestsResult>;
409
+ /**
410
+ * Compiles a Playwright script into an async function that may be executed at any time
411
+ * by providing it with the following object:
412
+ * ```
413
+ * {
414
+ * page: Page,
415
+ * request: Request,
416
+ * }
417
+ * ```
418
+ * Where `page` is a Playwright [`Page`](https://playwright.dev/docs/api/class-page)
419
+ * and `request` is a {@apilink Request}.
420
+ *
421
+ * The function is compiled by using the `scriptString` parameter as the function's body,
422
+ * so any limitations to function bodies apply. Return value of the compiled function
423
+ * is the return value of the function body = the `scriptString` parameter.
424
+ *
425
+ * As a security measure, no globals such as `process` or `require` are accessible
426
+ * from within the function body. Note that the function does not provide a safe
427
+ * sandbox and even though globals are not easily accessible, malicious code may
428
+ * still execute in the main process via prototype manipulation. Therefore you
429
+ * should only use this function to execute sanitized or safe code.
430
+ *
431
+ * Custom context may also be provided using the `context` parameter. To improve security,
432
+ * make sure to only pass the really necessary objects to the context. Preferably making
433
+ * secured copies beforehand.
434
+ */
435
+ compileScript(scriptString: string, ctx?: Dictionary): CompiledScriptFunction;
177
436
  }
178
437
  export declare function registerUtilsToContext(context: PlaywrightCrawlingContext): void;
438
+ export { enqueueLinksByClickingElements };
179
439
  /** @internal */
180
440
  export declare const playwrightUtils: {
181
441
  injectFile: typeof injectFile;
182
442
  injectJQuery: typeof injectJQuery;
183
443
  gotoExtended: typeof gotoExtended;
184
444
  blockRequests: typeof blockRequests;
445
+ enqueueLinksByClickingElements: typeof enqueueLinksByClickingElements;
185
446
  parseWithCheerio: typeof parseWithCheerio;
447
+ infiniteScroll: typeof infiniteScroll;
448
+ saveSnapshot: typeof saveSnapshot;
449
+ compileScript: typeof compileScript;
186
450
  };
187
451
  //# sourceMappingURL=playwright-utils.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;OAMG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,aAAa,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;;;;;;;;OAUG;IACH,gBAAgB,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;OAGG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,8BAA8B,CAAC,OAAO,EAAE,IAAI,CAAC,qCAAqC,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAE/I;;;;;;;;;;;;;;;;;;;;;;;;;MAyBE;IACF,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,sBAAsB,CAAC;CACjF;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAa/E;AAED,OAAO,EAAE,8BAA8B,EAAE,CAAC;AAE1C,gBAAgB;AAChB,eAAO,MAAM,eAAe;;;;;;;;;;CAU3B,CAAC"}
@@ -19,14 +19,17 @@
19
19
  * @module playwrightUtils
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.playwrightUtils = exports.registerUtilsToContext = exports.parseWithCheerio = exports.blockRequests = exports.gotoExtended = exports.injectJQuery = exports.injectFile = void 0;
22
+ exports.playwrightUtils = exports.enqueueLinksByClickingElements = exports.registerUtilsToContext = exports.parseWithCheerio = exports.saveSnapshot = exports.infiniteScroll = exports.compileScript = exports.blockRequests = exports.gotoExtended = exports.injectJQuery = exports.injectFile = void 0;
23
23
  const tslib_1 = require("tslib");
24
24
  const promises_1 = require("node:fs/promises");
25
25
  const ow_1 = tslib_1.__importDefault(require("ow"));
26
+ const vm_1 = tslib_1.__importDefault(require("vm"));
26
27
  const datastructures_1 = require("@apify/datastructures");
27
28
  const log_1 = tslib_1.__importDefault(require("@apify/log"));
28
- const core_1 = require("@crawlee/core");
29
+ const browser_1 = require("@crawlee/browser");
29
30
  const cheerio = tslib_1.__importStar(require("cheerio"));
31
+ const click_elements_1 = require("../enqueue-links/click-elements");
32
+ Object.defineProperty(exports, "enqueueLinksByClickingElements", { enumerable: true, get: function () { return click_elements_1.enqueueLinksByClickingElements; } });
30
33
  const log = log_1.default.child({ prefix: 'Playwright Utils' });
31
34
  const jqueryPath = require.resolve('jquery');
32
35
  const MAX_INJECT_FILE_CACHE_SIZE = 10;
@@ -47,7 +50,7 @@ const injectedFilesCache = new datastructures_1.LruCache({ maxLength: MAX_INJECT
47
50
  * @param [options]
48
51
  */
49
52
  async function injectFile(page, filePath, options = {}) {
50
- (0, ow_1.default)(page, ow_1.default.object.validate(core_1.validators.browserPage));
53
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
51
54
  (0, ow_1.default)(filePath, ow_1.default.string);
52
55
  (0, ow_1.default)(options, ow_1.default.object.exactShape({
53
56
  surviveNavigations: ow_1.default.optional.boolean,
@@ -91,7 +94,7 @@ exports.injectFile = injectFile;
91
94
  * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
92
95
  */
93
96
  function injectJQuery(page) {
94
- (0, ow_1.default)(page, ow_1.default.object.validate(core_1.validators.browserPage));
97
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
95
98
  return injectFile(page, jqueryPath, { surviveNavigations: true });
96
99
  }
97
100
  exports.injectJQuery = injectJQuery;
@@ -108,7 +111,7 @@ exports.injectJQuery = injectJQuery;
108
111
  * @param [gotoOptions] Custom options for `page.goto()`.
109
112
  */
110
113
  async function gotoExtended(page, request, gotoOptions = {}) {
111
- (0, ow_1.default)(page, ow_1.default.object.validate(core_1.validators.browserPage));
114
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
112
115
  (0, ow_1.default)(request, ow_1.default.object.partialShape({
113
116
  url: ow_1.default.string.url,
114
117
  method: ow_1.default.optional.string,
@@ -192,7 +195,7 @@ exports.gotoExtended = gotoExtended;
192
195
  * @param [options]
193
196
  */
194
197
  async function blockRequests(page, options = {}) {
195
- (0, ow_1.default)(page, ow_1.default.object.validate(core_1.validators.browserPage));
198
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
196
199
  (0, ow_1.default)(options, ow_1.default.object.exactShape({
197
200
  urlPatterns: ow_1.default.optional.array.ofType(ow_1.default.string),
198
201
  extraUrlPatterns: ow_1.default.optional.array.ofType(ow_1.default.string),
@@ -204,6 +207,173 @@ async function blockRequests(page, options = {}) {
204
207
  await client.send('Network.setBlockedURLs', { urls: patternsToBlock });
205
208
  }
206
209
  exports.blockRequests = blockRequests;
210
+ /**
211
+ * Compiles a Playwright script into an async function that may be executed at any time
212
+ * by providing it with the following object:
213
+ * ```
214
+ * {
215
+ * page: Page,
216
+ * request: Request,
217
+ * }
218
+ * ```
219
+ * Where `page` is a Playwright [`Page`](https://playwright.dev/docs/api/class-page)
220
+ * and `request` is a {@apilink Request}.
221
+ *
222
+ * The function is compiled by using the `scriptString` parameter as the function's body,
223
+ * so any limitations to function bodies apply. Return value of the compiled function
224
+ * is the return value of the function body = the `scriptString` parameter.
225
+ *
226
+ * As a security measure, no globals such as `process` or `require` are accessible
227
+ * from within the function body. Note that the function does not provide a safe
228
+ * sandbox and even though globals are not easily accessible, malicious code may
229
+ * still execute in the main process via prototype manipulation. Therefore you
230
+ * should only use this function to execute sanitized or safe code.
231
+ *
232
+ * Custom context may also be provided using the `context` parameter. To improve security,
233
+ * make sure to only pass the really necessary objects to the context. Preferably making
234
+ * secured copies beforehand.
235
+ */
236
+ function compileScript(scriptString, context = Object.create(null)) {
237
+ const funcString = `async ({ page, request }) => {${scriptString}}`;
238
+ let func;
239
+ try {
240
+ func = vm_1.default.runInNewContext(funcString, context); // "Secure" the context by removing prototypes, unless custom context is provided.
241
+ }
242
+ catch (err) {
243
+ log.exception(err, 'Cannot compile script!');
244
+ throw err;
245
+ }
246
+ if (typeof func !== 'function')
247
+ throw new Error('Compilation result is not a function!'); // This should not happen...
248
+ return func;
249
+ }
250
+ exports.compileScript = compileScript;
251
+ /**
252
+ * Scrolls to the bottom of a page, or until it times out.
253
+ * Loads dynamic content when it hits the bottom of a page, and then continues scrolling.
254
+ * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
255
+ * @param [options]
256
+ */
257
+ async function infiniteScroll(page, options = {}) {
258
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
259
+ (0, ow_1.default)(options, ow_1.default.object.exactShape({
260
+ timeoutSecs: ow_1.default.optional.number,
261
+ waitForSecs: ow_1.default.optional.number,
262
+ scrollDownAndUp: ow_1.default.optional.boolean,
263
+ buttonSelector: ow_1.default.optional.string,
264
+ stopScrollCallback: ow_1.default.optional.function,
265
+ }));
266
+ const { timeoutSecs = 0, waitForSecs = 4, scrollDownAndUp = false, buttonSelector, stopScrollCallback } = options;
267
+ let finished;
268
+ const startTime = Date.now();
269
+ const CHECK_INTERVAL_MILLIS = 1000;
270
+ const SCROLL_HEIGHT_IF_ZERO = 10000;
271
+ const maybeResourceTypesInfiniteScroll = ['xhr', 'fetch', 'websocket', 'other'];
272
+ const resourcesStats = {
273
+ newRequested: 0,
274
+ oldRequested: 0,
275
+ matchNumber: 0,
276
+ };
277
+ page.on('request', (msg) => {
278
+ if (maybeResourceTypesInfiniteScroll.includes(msg.resourceType())) {
279
+ resourcesStats.newRequested++;
280
+ }
281
+ });
282
+ // Move mouse to the center of the page, so we can scroll up-down
283
+ let body = await page.$('body');
284
+ for (let retry = 0; retry < 10; retry++) {
285
+ if (body)
286
+ break;
287
+ await page.waitForTimeout(100);
288
+ body = await page.$('body');
289
+ }
290
+ if (!body) {
291
+ return;
292
+ }
293
+ const boundingBox = await body.boundingBox();
294
+ await page.mouse.move(boundingBox.x + boundingBox.width / 2, boundingBox.y + boundingBox.height / 2);
295
+ const checkFinished = setInterval(() => {
296
+ if (resourcesStats.oldRequested === resourcesStats.newRequested) {
297
+ resourcesStats.matchNumber++;
298
+ if (resourcesStats.matchNumber >= waitForSecs) {
299
+ clearInterval(checkFinished);
300
+ finished = true;
301
+ return;
302
+ }
303
+ }
304
+ else {
305
+ resourcesStats.matchNumber = 0;
306
+ resourcesStats.oldRequested = resourcesStats.newRequested;
307
+ }
308
+ // check if timeout has been reached
309
+ if (timeoutSecs !== 0 && (Date.now() - startTime) / 1000 > timeoutSecs) {
310
+ clearInterval(checkFinished);
311
+ finished = true;
312
+ }
313
+ }, CHECK_INTERVAL_MILLIS);
314
+ const doScroll = async () => {
315
+ const bodyScrollHeight = await page.evaluate(() => document.body.scrollHeight);
316
+ const delta = bodyScrollHeight === 0 ? SCROLL_HEIGHT_IF_ZERO : bodyScrollHeight;
317
+ await page.mouse.wheel(0, delta);
318
+ };
319
+ const maybeClickButton = async () => {
320
+ const button = await page.$(buttonSelector);
321
+ // Box model returns null if the button is not visible
322
+ if (button && await button.boundingBox()) {
323
+ await button.click({ delay: 10 });
324
+ }
325
+ };
326
+ while (!finished) {
327
+ await doScroll();
328
+ await page.waitForTimeout(250);
329
+ if (scrollDownAndUp) {
330
+ await page.mouse.wheel(0, -1000);
331
+ }
332
+ if (buttonSelector) {
333
+ await maybeClickButton();
334
+ }
335
+ if (stopScrollCallback) {
336
+ if (await stopScrollCallback()) {
337
+ clearInterval(checkFinished);
338
+ break;
339
+ }
340
+ }
341
+ }
342
+ }
343
+ exports.infiniteScroll = infiniteScroll;
344
+ /**
345
+ * Saves a full screenshot and HTML of the current page into a Key-Value store.
346
+ * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
347
+ * @param [options]
348
+ */
349
+ async function saveSnapshot(page, options = {}) {
350
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
351
+ (0, ow_1.default)(options, ow_1.default.object.exactShape({
352
+ key: ow_1.default.optional.string.nonEmpty,
353
+ screenshotQuality: ow_1.default.optional.number,
354
+ saveScreenshot: ow_1.default.optional.boolean,
355
+ saveHtml: ow_1.default.optional.boolean,
356
+ keyValueStoreName: ow_1.default.optional.string,
357
+ }));
358
+ const { key = 'SNAPSHOT', screenshotQuality = 50, saveScreenshot = true, saveHtml = true, keyValueStoreName, } = options;
359
+ try {
360
+ const store = await browser_1.KeyValueStore.open(keyValueStoreName);
361
+ if (saveScreenshot) {
362
+ const screenshotName = `${key}.jpg`;
363
+ const screenshotBuffer = await page.screenshot({ fullPage: true, quality: screenshotQuality, type: 'jpeg' });
364
+ await store.setValue(screenshotName, screenshotBuffer, { contentType: 'image/jpeg' });
365
+ }
366
+ if (saveHtml) {
367
+ const htmlName = `${key}.html`;
368
+ const html = await page.content();
369
+ await store.setValue(htmlName, html, { contentType: 'text/html' });
370
+ }
371
+ }
372
+ catch (err) {
373
+ throw new Error(`saveSnapshot with key ${key} failed.\nCause:${err.message}`);
374
+ }
375
+ }
376
+ exports.saveSnapshot = saveSnapshot;
207
377
  /**
208
378
  * Returns Cheerio handle for `page.content()`, allowing to work with the data same way as with {@apilink CheerioCrawler}.
209
379
  *
@@ -216,7 +386,7 @@ exports.blockRequests = blockRequests;
216
386
  * @param page Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
217
387
  */
218
388
  async function parseWithCheerio(page) {
219
- (0, ow_1.default)(page, ow_1.default.object.validate(core_1.validators.browserPage));
389
+ (0, ow_1.default)(page, ow_1.default.object.validate(browser_1.validators.browserPage));
220
390
  const pageContent = await page.content();
221
391
  return cheerio.load(pageContent);
222
392
  }
@@ -226,6 +396,14 @@ function registerUtilsToContext(context) {
226
396
  context.injectJQuery = () => injectJQuery(context.page);
227
397
  context.blockRequests = (options) => blockRequests(context.page, options);
228
398
  context.parseWithCheerio = () => parseWithCheerio(context.page);
399
+ context.infiniteScroll = (options) => infiniteScroll(context.page, options);
400
+ context.saveSnapshot = (options) => saveSnapshot(context.page, options);
401
+ context.enqueueLinksByClickingElements = (options) => (0, click_elements_1.enqueueLinksByClickingElements)({
402
+ ...options,
403
+ page: context.page,
404
+ requestQueue: context.crawler.requestQueue,
405
+ });
406
+ context.compileScript = (scriptString, ctx) => compileScript(scriptString, ctx);
229
407
  }
230
408
  exports.registerUtilsToContext = registerUtilsToContext;
231
409
  /** @internal */
@@ -234,6 +412,10 @@ exports.playwrightUtils = {
234
412
  injectJQuery,
235
413
  gotoExtended,
236
414
  blockRequests,
415
+ enqueueLinksByClickingElements: click_elements_1.enqueueLinksByClickingElements,
237
416
  parseWithCheerio,
417
+ infiniteScroll,
418
+ saveSnapshot,
419
+ compileScript,
238
420
  };
239
421
  //# sourceMappingURL=playwright-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"playwright-utils.js","sourceRoot":"","sources":["../../../src/internals/utils/playwright-utils.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;AAEH,+CAA4C;AAC5C,oDAAoB;AAEpB,0DAAiD;AACjD,6DAA8B;AAE9B,wCAA2C;AAE3C,yDAAmC;AAGnC,MAAM,GAAG,GAAG,aAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAEvD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,0BAA0B,GAAG,EAAE,CAAC;AACtC,MAAM,kCAAkC,GAAG,CA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AC,CAAC;AACzG,CAAC;AAbD,wDAaC;AAID,gBAAgB;AACH,QAAA,eAAe,GAAG;IAC3B,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,8BAA8B,EAA9B,+CAA8B;IAC9B,gBAAgB;IAChB,cAAc;IACd,YAAY;IACZ,aAAa;CAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/playwright",
3
- "version": "3.0.5-beta.8",
3
+ "version": "3.1.0",
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": ">=16.0.0"
@@ -55,10 +55,10 @@
55
55
  "dependencies": {
56
56
  "@apify/datastructures": "^2.0.0",
57
57
  "@apify/log": "^2.0.0",
58
- "@crawlee/browser": "^3.0.5-beta.8",
59
- "@crawlee/browser-pool": "^3.0.5-beta.8",
60
- "@crawlee/core": "^3.0.5-beta.8",
61
- "@crawlee/utils": "^3.0.5-beta.8",
58
+ "@crawlee/browser": "^3.1.0",
59
+ "@crawlee/browser-pool": "^3.1.0",
60
+ "@crawlee/types": "^3.1.0",
61
+ "@crawlee/utils": "^3.1.0",
62
62
  "cheerio": "1.0.0-rc.12",
63
63
  "jquery": "^3.6.0",
64
64
  "ow": "^0.28.1"