@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.
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -1
- package/index.js.map +1 -1
- package/index.mjs +3 -0
- package/internals/enqueue-links/click-elements.d.ts +189 -0
- package/internals/enqueue-links/click-elements.d.ts.map +1 -0
- package/internals/enqueue-links/click-elements.js +317 -0
- package/internals/enqueue-links/click-elements.js.map +1 -0
- package/internals/playwright-crawler.d.ts +2 -1
- package/internals/playwright-crawler.d.ts.map +1 -1
- package/internals/playwright-crawler.js +5 -0
- package/internals/playwright-crawler.js.map +1 -1
- package/internals/playwright-launcher.js.map +1 -1
- package/internals/utils/playwright-utils.d.ts +266 -2
- package/internals/utils/playwright-utils.d.ts.map +1 -1
- package/internals/utils/playwright-utils.js +189 -7
- package/internals/utils/playwright-utils.js.map +1 -1
- package/package.json +5 -5
- package/tsconfig.build.tsbuildinfo +1 -1
package/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export * from '@crawlee/browser';
|
|
|
2
2
|
export * from './internals/playwright-crawler';
|
|
3
3
|
export * from './internals/playwright-launcher';
|
|
4
4
|
export * as playwrightUtils from './internals/utils/playwright-utils';
|
|
5
|
+
export * as playwrightClickElements from './internals/enqueue-links/click-elements';
|
|
5
6
|
export type { DirectNavigationOptions as PlaywrightDirectNavigationOptions } from './internals/utils/playwright-utils';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAEhD,OAAO,KAAK,eAAe,MAAM,oCAAoC,CAAC;AACtE,YAAY,EAAE,uBAAuB,IAAI,iCAAiC,EAAE,MAAM,oCAAoC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAEhD,OAAO,KAAK,eAAe,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,uBAAuB,MAAM,0CAA0C,CAAC;AACpF,YAAY,EAAE,uBAAuB,IAAI,iCAAiC,EAAE,MAAM,oCAAoC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.playwrightUtils = void 0;
|
|
3
|
+
exports.playwrightClickElements = exports.playwrightUtils = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
tslib_1.__exportStar(require("@crawlee/browser"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./internals/playwright-crawler"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./internals/playwright-launcher"), exports);
|
|
8
8
|
exports.playwrightUtils = tslib_1.__importStar(require("./internals/utils/playwright-utils"));
|
|
9
|
+
exports.playwrightClickElements = tslib_1.__importStar(require("./internals/enqueue-links/click-elements"));
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAiC;AACjC,yEAA+C;AAC/C,0EAAgD;AAEhD,8FAAsE"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAiC;AACjC,yEAA+C;AAC/C,0EAAgD;AAEhD,8FAAsE;AACtE,4GAAoF"}
|
package/index.mjs
CHANGED
|
@@ -62,6 +62,7 @@ export const createRequestOptions = mod.createRequestOptions;
|
|
|
62
62
|
export const createRequests = mod.createRequests;
|
|
63
63
|
export const deserializeArray = mod.deserializeArray;
|
|
64
64
|
export const enqueueLinks = mod.enqueueLinks;
|
|
65
|
+
export const filterRequestsByPatterns = mod.filterRequestsByPatterns;
|
|
65
66
|
export const getCookiesFromResponse = mod.getCookiesFromResponse;
|
|
66
67
|
export const getDefaultCookieExpirationDate = mod.getDefaultCookieExpirationDate;
|
|
67
68
|
export const getRequestId = mod.getRequestId;
|
|
@@ -70,11 +71,13 @@ export const launchPlaywright = mod.launchPlaywright;
|
|
|
70
71
|
export const log = mod.log;
|
|
71
72
|
export const maybeStringify = mod.maybeStringify;
|
|
72
73
|
export const mergeCookies = mod.mergeCookies;
|
|
74
|
+
export const playwrightClickElements = mod.playwrightClickElements;
|
|
73
75
|
export const playwrightUtils = mod.playwrightUtils;
|
|
74
76
|
export const purgeDefaultStorages = mod.purgeDefaultStorages;
|
|
75
77
|
export const resolveBaseUrlForEnqueueLinksFiltering = mod.resolveBaseUrlForEnqueueLinksFiltering;
|
|
76
78
|
export const serializeArray = mod.serializeArray;
|
|
77
79
|
export const toughCookieToBrowserPoolCookie = mod.toughCookieToBrowserPoolCookie;
|
|
78
80
|
export const updateEnqueueLinksPatternCache = mod.updateEnqueueLinksPatternCache;
|
|
81
|
+
export const useState = mod.useState;
|
|
79
82
|
export const validateGlobPattern = mod.validateGlobPattern;
|
|
80
83
|
export const validators = mod.validators;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { GlobInput, PseudoUrlInput, RegExpInput, RequestTransform, RequestQueue } from '@crawlee/browser';
|
|
2
|
+
import type { Dictionary, BatchAddRequestsResult } from '@crawlee/types';
|
|
3
|
+
// @ts-ignore optional peer dependency
|
|
4
|
+
import type { Page } from 'playwright';
|
|
5
|
+
declare type ClickOptions = Parameters<Page['click']>[1];
|
|
6
|
+
export interface EnqueueLinksByClickingElementsOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Playwright [`Page`](https://playwright.dev/docs/api/class-page) object.
|
|
9
|
+
*/
|
|
10
|
+
page: Page;
|
|
11
|
+
/**
|
|
12
|
+
* A request queue to which the URLs will be enqueued.
|
|
13
|
+
*/
|
|
14
|
+
requestQueue: RequestQueue;
|
|
15
|
+
/**
|
|
16
|
+
* A CSS selector matching elements to be clicked on. Unlike in {@apilink enqueueLinks}, there is no default
|
|
17
|
+
* value. This is to prevent suboptimal use of this function by using it too broadly.
|
|
18
|
+
*/
|
|
19
|
+
selector: string;
|
|
20
|
+
/** Sets {@apilink Request.userData} for newly enqueued requests. */
|
|
21
|
+
userData?: Dictionary;
|
|
22
|
+
/** Sets {@apilink Request.label} for newly enqueued requests. */
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Click options for use in Playwright click handler.
|
|
26
|
+
*/
|
|
27
|
+
clickOptions?: ClickOptions;
|
|
28
|
+
/**
|
|
29
|
+
* An array of glob pattern strings or plain objects
|
|
30
|
+
* containing glob pattern strings matching the URLs to be enqueued.
|
|
31
|
+
*
|
|
32
|
+
* The plain objects must include at least the `glob` property, which holds the glob pattern string.
|
|
33
|
+
* All remaining keys will be used as request options for the corresponding enqueued {@apilink Request} objects.
|
|
34
|
+
*
|
|
35
|
+
* The matching is always case-insensitive.
|
|
36
|
+
* If you need case-sensitive matching, use `regexps` property directly.
|
|
37
|
+
*
|
|
38
|
+
* If `globs` is an empty array or `undefined`, then the function
|
|
39
|
+
* enqueues all the intercepted navigation requests produced by the page
|
|
40
|
+
* after clicking on elements matching the provided CSS selector.
|
|
41
|
+
*/
|
|
42
|
+
globs?: GlobInput[];
|
|
43
|
+
/**
|
|
44
|
+
* An array of regular expressions or plain objects
|
|
45
|
+
* containing regular expressions matching the URLs to be enqueued.
|
|
46
|
+
*
|
|
47
|
+
* The plain objects must include at least the `regexp` property, which holds the regular expression.
|
|
48
|
+
* All remaining keys will be used as request options for the corresponding enqueued {@apilink Request} objects.
|
|
49
|
+
*
|
|
50
|
+
* If `regexps` is an empty array or `undefined`, then the function
|
|
51
|
+
* enqueues all the intercepted navigation requests produced by the page
|
|
52
|
+
* after clicking on elements matching the provided CSS selector.
|
|
53
|
+
*/
|
|
54
|
+
regexps?: RegExpInput[];
|
|
55
|
+
/**
|
|
56
|
+
* *NOTE:* In future versions of SDK the options will be removed.
|
|
57
|
+
* Please use `globs` or `regexps` instead.
|
|
58
|
+
*
|
|
59
|
+
* An array of {@apilink PseudoUrl} strings or plain objects
|
|
60
|
+
* containing {@apilink PseudoUrl} strings matching the URLs to be enqueued.
|
|
61
|
+
*
|
|
62
|
+
* The plain objects must include at least the `purl` property, which holds the pseudo-URL pattern string.
|
|
63
|
+
* All remaining keys will be used as request options for the corresponding enqueued {@apilink Request} objects.
|
|
64
|
+
*
|
|
65
|
+
* With a pseudo-URL string, the matching is always case-insensitive.
|
|
66
|
+
* If you need case-sensitive matching, use `regexps` property directly.
|
|
67
|
+
*
|
|
68
|
+
* If `pseudoUrls` is an empty array or `undefined`, then the function
|
|
69
|
+
* enqueues all the intercepted navigation requests produced by the page
|
|
70
|
+
* after clicking on elements matching the provided CSS selector.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated prefer using `globs` or `regexps` instead
|
|
73
|
+
*/
|
|
74
|
+
pseudoUrls?: PseudoUrlInput[];
|
|
75
|
+
/**
|
|
76
|
+
* Just before a new {@apilink Request} is constructed and enqueued to the {@apilink RequestQueue}, this function can be used
|
|
77
|
+
* to remove it or modify its contents such as `userData`, `payload` or, most importantly `uniqueKey`. This is useful
|
|
78
|
+
* when you need to enqueue multiple `Requests` to the queue that share the same URL, but differ in methods or payloads,
|
|
79
|
+
* or to dynamically update or create `userData`.
|
|
80
|
+
*
|
|
81
|
+
* For example: by adding `useExtendedUniqueKey: true` to the `request` object, `uniqueKey` will be computed from
|
|
82
|
+
* a combination of `url`, `method` and `payload` which enables crawling of websites that navigate using form submits
|
|
83
|
+
* (POST requests).
|
|
84
|
+
*
|
|
85
|
+
* **Example:**
|
|
86
|
+
* ```javascript
|
|
87
|
+
* {
|
|
88
|
+
* transformRequestFunction: (request) => {
|
|
89
|
+
* request.userData.foo = 'bar';
|
|
90
|
+
* request.useExtendedUniqueKey = true;
|
|
91
|
+
* return request;
|
|
92
|
+
* }
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
transformRequestFunction?: RequestTransform;
|
|
97
|
+
/**
|
|
98
|
+
* Clicking in the page triggers various asynchronous operations that lead to new URLs being shown
|
|
99
|
+
* by the browser. It could be a simple JavaScript redirect or opening of a new tab in the browser.
|
|
100
|
+
* These events often happen only some time after the actual click. Requests typically take milliseconds
|
|
101
|
+
* while new tabs open in hundreds of milliseconds.
|
|
102
|
+
*
|
|
103
|
+
* To be able to capture all those events, the `enqueueLinksByClickingElements()` function repeatedly waits
|
|
104
|
+
* for the `waitForPageIdleSecs`. By repeatedly we mean that whenever a relevant event is triggered, the timer
|
|
105
|
+
* is restarted. As long as new events keep coming, the function will not return, unless
|
|
106
|
+
* the below `maxWaitForPageIdleSecs` timeout is reached.
|
|
107
|
+
*
|
|
108
|
+
* You may want to reduce this for example when you're sure that your clicks do not open new tabs,
|
|
109
|
+
* or increase when you're not getting all the expected URLs.
|
|
110
|
+
* @default 1
|
|
111
|
+
*/
|
|
112
|
+
waitForPageIdleSecs?: number;
|
|
113
|
+
/**
|
|
114
|
+
* This is the maximum period for which the function will keep tracking events, even if more events keep coming.
|
|
115
|
+
* Its purpose is to prevent a deadlock in the page by periodic events, often unrelated to the clicking itself.
|
|
116
|
+
* See `waitForPageIdleSecs` above for an explanation.
|
|
117
|
+
* @default 5
|
|
118
|
+
*/
|
|
119
|
+
maxWaitForPageIdleSecs?: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The function finds elements matching a specific CSS selector in a Playwright page,
|
|
123
|
+
* clicks all those elements using a mouse move and a left mouse button click and intercepts
|
|
124
|
+
* all the navigation requests that are subsequently produced by the page. The intercepted
|
|
125
|
+
* requests, including their methods, headers and payloads are then enqueued to a provided
|
|
126
|
+
* {@apilink RequestQueue}. This is useful to crawl JavaScript heavy pages where links are not available
|
|
127
|
+
* in `href` elements, but rather navigations are triggered in click handlers.
|
|
128
|
+
* If you're looking to find URLs in `href` attributes of the page, see {@apilink enqueueLinks}.
|
|
129
|
+
*
|
|
130
|
+
* Optionally, the function allows you to filter the target links' URLs using an array of {@apilink PseudoUrl} objects
|
|
131
|
+
* and override settings of the enqueued {@apilink Request} objects.
|
|
132
|
+
*
|
|
133
|
+
* **IMPORTANT**: To be able to do this, this function uses various mutations on the page,
|
|
134
|
+
* such as changing the Z-index of elements being clicked and their visibility. Therefore,
|
|
135
|
+
* it is recommended to only use this function as the last operation in the page.
|
|
136
|
+
*
|
|
137
|
+
* **USING HEADFUL BROWSER**: When using a headful browser, this function will only be able to click elements
|
|
138
|
+
* in the focused tab, effectively limiting concurrency to 1. In headless mode, full concurrency can be achieved.
|
|
139
|
+
*
|
|
140
|
+
* **PERFORMANCE**: Clicking elements with a mouse and intercepting requests is not a low level operation
|
|
141
|
+
* that takes nanoseconds. It's not very CPU intensive, but it takes time. We strongly recommend limiting
|
|
142
|
+
* the scope of the clicking as much as possible by using a specific selector that targets only the elements
|
|
143
|
+
* that you assume or know will produce a navigation. You can certainly click everything by using
|
|
144
|
+
* the `*` selector, but be prepared to wait minutes to get results on a large and complex page.
|
|
145
|
+
*
|
|
146
|
+
* **Example usage**
|
|
147
|
+
*
|
|
148
|
+
* ```javascript
|
|
149
|
+
* await playwrightUtils.enqueueLinksByClickingElements({
|
|
150
|
+
* page,
|
|
151
|
+
* requestQueue,
|
|
152
|
+
* selector: 'a.product-detail',
|
|
153
|
+
* pseudoUrls: [
|
|
154
|
+
* 'https://www.example.com/handbags/[.*]'
|
|
155
|
+
* 'https://www.example.com/purses/[.*]'
|
|
156
|
+
* ],
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @returns Promise that resolves to {@apilink BatchAddRequestsResult} object.
|
|
161
|
+
*/
|
|
162
|
+
export declare function enqueueLinksByClickingElements(options: EnqueueLinksByClickingElementsOptions): Promise<BatchAddRequestsResult>;
|
|
163
|
+
interface WaitForPageIdleOptions {
|
|
164
|
+
page: Page;
|
|
165
|
+
waitForPageIdleMillis?: number;
|
|
166
|
+
maxWaitForPageIdleMillis?: number;
|
|
167
|
+
}
|
|
168
|
+
interface ClickElementsAndInterceptNavigationRequestsOptions extends WaitForPageIdleOptions {
|
|
169
|
+
selector: string;
|
|
170
|
+
clickOptions?: ClickOptions;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Clicks all elements of given page matching given selector.
|
|
174
|
+
* Catches and intercepts all initiated navigation requests and opened pages.
|
|
175
|
+
* Returns a list of all target URLs.
|
|
176
|
+
* @ignore
|
|
177
|
+
*/
|
|
178
|
+
export declare function clickElementsAndInterceptNavigationRequests(options: ClickElementsAndInterceptNavigationRequestsOptions): Promise<Dictionary[]>;
|
|
179
|
+
/**
|
|
180
|
+
* Click all elements matching the given selector. To be able to do this using
|
|
181
|
+
* Playwright's `.click()` we need to make sure the elements are reachable by mouse,
|
|
182
|
+
* so we first move them to the top of the page's stacking context and then click.
|
|
183
|
+
* We do all in series to prevent elements from hiding one another. Therefore,
|
|
184
|
+
* for large element sets, this will take considerable amount of time.
|
|
185
|
+
* @ignore
|
|
186
|
+
*/
|
|
187
|
+
export declare function clickElements(page: Page, selector: string, clickOptions?: ClickOptions): Promise<void>;
|
|
188
|
+
export {};
|
|
189
|
+
//# sourceMappingURL=click-elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-elements.d.ts","sourceRoot":"","sources":["../../../src/internals/enqueue-links/click-elements.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACX,gBAAgB,EAEhB,YAAY,EAEf,MAAM,kBAAkB,CAAC;AAS1B,OAAO,KAAK,EAAE,UAA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F,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAsB,2CAA2C,CAAC,OAAO,EAAE,kDAAkD,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAkCpJ;AAgHD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5G"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickElements = exports.clickElementsAndInterceptNavigationRequests = exports.enqueueLinksByClickingElements = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const browser_1 = require("@crawlee/browser");
|
|
6
|
+
const log_1 = tslib_1.__importDefault(require("@apify/log"));
|
|
7
|
+
const ow_1 = tslib_1.__importDefault(require("ow"));
|
|
8
|
+
const url_1 = require("url");
|
|
9
|
+
const STARTING_Z_INDEX = 2147400000;
|
|
10
|
+
const log = log_1.default.child({ prefix: 'Playwright Click Elements' });
|
|
11
|
+
/**
|
|
12
|
+
* The function finds elements matching a specific CSS selector in a Playwright page,
|
|
13
|
+
* clicks all those elements using a mouse move and a left mouse button click and intercepts
|
|
14
|
+
* all the navigation requests that are subsequently produced by the page. The intercepted
|
|
15
|
+
* requests, including their methods, headers and payloads are then enqueued to a provided
|
|
16
|
+
* {@apilink RequestQueue}. This is useful to crawl JavaScript heavy pages where links are not available
|
|
17
|
+
* in `href` elements, but rather navigations are triggered in click handlers.
|
|
18
|
+
* If you're looking to find URLs in `href` attributes of the page, see {@apilink enqueueLinks}.
|
|
19
|
+
*
|
|
20
|
+
* Optionally, the function allows you to filter the target links' URLs using an array of {@apilink PseudoUrl} objects
|
|
21
|
+
* and override settings of the enqueued {@apilink Request} objects.
|
|
22
|
+
*
|
|
23
|
+
* **IMPORTANT**: To be able to do this, this function uses various mutations on the page,
|
|
24
|
+
* such as changing the Z-index of elements being clicked and their visibility. Therefore,
|
|
25
|
+
* it is recommended to only use this function as the last operation in the page.
|
|
26
|
+
*
|
|
27
|
+
* **USING HEADFUL BROWSER**: When using a headful browser, this function will only be able to click elements
|
|
28
|
+
* in the focused tab, effectively limiting concurrency to 1. In headless mode, full concurrency can be achieved.
|
|
29
|
+
*
|
|
30
|
+
* **PERFORMANCE**: Clicking elements with a mouse and intercepting requests is not a low level operation
|
|
31
|
+
* that takes nanoseconds. It's not very CPU intensive, but it takes time. We strongly recommend limiting
|
|
32
|
+
* the scope of the clicking as much as possible by using a specific selector that targets only the elements
|
|
33
|
+
* that you assume or know will produce a navigation. You can certainly click everything by using
|
|
34
|
+
* the `*` selector, but be prepared to wait minutes to get results on a large and complex page.
|
|
35
|
+
*
|
|
36
|
+
* **Example usage**
|
|
37
|
+
*
|
|
38
|
+
* ```javascript
|
|
39
|
+
* await playwrightUtils.enqueueLinksByClickingElements({
|
|
40
|
+
* page,
|
|
41
|
+
* requestQueue,
|
|
42
|
+
* selector: 'a.product-detail',
|
|
43
|
+
* pseudoUrls: [
|
|
44
|
+
* 'https://www.example.com/handbags/[.*]'
|
|
45
|
+
* 'https://www.example.com/purses/[.*]'
|
|
46
|
+
* ],
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* @returns Promise that resolves to {@apilink BatchAddRequestsResult} object.
|
|
51
|
+
*/
|
|
52
|
+
async function enqueueLinksByClickingElements(options) {
|
|
53
|
+
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
54
|
+
page: ow_1.default.object.hasKeys('goto', 'evaluate'),
|
|
55
|
+
requestQueue: ow_1.default.object.hasKeys('fetchNextRequest', 'addRequest'),
|
|
56
|
+
selector: ow_1.default.string,
|
|
57
|
+
clickOptions: ow_1.default.optional.object.hasKeys('clickCount', 'delay'),
|
|
58
|
+
pseudoUrls: ow_1.default.optional.array.ofType(ow_1.default.any(ow_1.default.string, ow_1.default.object.hasKeys('purl'))),
|
|
59
|
+
globs: ow_1.default.optional.array.ofType(ow_1.default.any(ow_1.default.string, ow_1.default.object.hasKeys('glob'))),
|
|
60
|
+
regexps: ow_1.default.optional.array.ofType(ow_1.default.any(ow_1.default.regExp, ow_1.default.object.hasKeys('regexp'))),
|
|
61
|
+
transformRequestFunction: ow_1.default.optional.function,
|
|
62
|
+
waitForPageIdleSecs: ow_1.default.optional.number,
|
|
63
|
+
maxWaitForPageIdleSecs: ow_1.default.optional.number,
|
|
64
|
+
label: ow_1.default.optional.string,
|
|
65
|
+
}));
|
|
66
|
+
const { page, requestQueue, selector, clickOptions, pseudoUrls, globs, regexps, transformRequestFunction, waitForPageIdleSecs = 1, maxWaitForPageIdleSecs = 5, } = options;
|
|
67
|
+
const waitForPageIdleMillis = waitForPageIdleSecs * 1000;
|
|
68
|
+
const maxWaitForPageIdleMillis = maxWaitForPageIdleSecs * 1000;
|
|
69
|
+
const urlPatternObjects = [];
|
|
70
|
+
if (pseudoUrls?.length) {
|
|
71
|
+
log.deprecated('`pseudoUrls` option is deprecated, use `globs` or `regexps` instead');
|
|
72
|
+
urlPatternObjects.push(...(0, browser_1.constructRegExpObjectsFromPseudoUrls)(pseudoUrls));
|
|
73
|
+
}
|
|
74
|
+
if (globs?.length) {
|
|
75
|
+
urlPatternObjects.push(...(0, browser_1.constructGlobObjectsFromGlobs)(globs));
|
|
76
|
+
}
|
|
77
|
+
if (regexps?.length) {
|
|
78
|
+
urlPatternObjects.push(...(0, browser_1.constructRegExpObjectsFromRegExps)(regexps));
|
|
79
|
+
}
|
|
80
|
+
const interceptedRequests = await clickElementsAndInterceptNavigationRequests({
|
|
81
|
+
page,
|
|
82
|
+
selector,
|
|
83
|
+
waitForPageIdleMillis,
|
|
84
|
+
maxWaitForPageIdleMillis,
|
|
85
|
+
clickOptions,
|
|
86
|
+
});
|
|
87
|
+
let requestOptions = (0, browser_1.createRequestOptions)(interceptedRequests, options);
|
|
88
|
+
if (transformRequestFunction) {
|
|
89
|
+
requestOptions = requestOptions.map(transformRequestFunction).filter((r) => !!r);
|
|
90
|
+
}
|
|
91
|
+
const requests = (0, browser_1.createRequests)(requestOptions, urlPatternObjects);
|
|
92
|
+
return requestQueue.addRequests(requests);
|
|
93
|
+
}
|
|
94
|
+
exports.enqueueLinksByClickingElements = enqueueLinksByClickingElements;
|
|
95
|
+
/**
|
|
96
|
+
* Clicks all elements of given page matching given selector.
|
|
97
|
+
* Catches and intercepts all initiated navigation requests and opened pages.
|
|
98
|
+
* Returns a list of all target URLs.
|
|
99
|
+
* @ignore
|
|
100
|
+
*/
|
|
101
|
+
async function clickElementsAndInterceptNavigationRequests(options) {
|
|
102
|
+
const { page, selector, waitForPageIdleMillis, maxWaitForPageIdleMillis, clickOptions, } = options;
|
|
103
|
+
const uniqueRequests = new Set();
|
|
104
|
+
const context = page.context();
|
|
105
|
+
const onInterceptedRequest = createInterceptRequestHandler(page, uniqueRequests);
|
|
106
|
+
const onPopup = createTargetCreatedHandler(uniqueRequests);
|
|
107
|
+
const onFrameNavigated = createFrameNavigatedHandler(page, uniqueRequests);
|
|
108
|
+
await context.route('**', onInterceptedRequest);
|
|
109
|
+
// context.on('BrowserEmittedEvents.TargetCreated', onTargetCreated);
|
|
110
|
+
page.on('framenavigated', onFrameNavigated);
|
|
111
|
+
page.on('popup', onPopup);
|
|
112
|
+
await preventHistoryNavigation(page);
|
|
113
|
+
await clickElements(page, selector, clickOptions);
|
|
114
|
+
await waitForPageIdle({ page, waitForPageIdleMillis, maxWaitForPageIdleMillis });
|
|
115
|
+
await restoreHistoryNavigationAndSaveCapturedUrls(page, uniqueRequests);
|
|
116
|
+
// browser.off(BrowserEmittedEvents.TargetCreated, onTargetCreated);
|
|
117
|
+
page.off('framenavigated', onFrameNavigated);
|
|
118
|
+
await context.unroute('*', onInterceptedRequest);
|
|
119
|
+
const serializedRequests = Array.from(uniqueRequests);
|
|
120
|
+
return serializedRequests.map((r) => JSON.parse(r));
|
|
121
|
+
}
|
|
122
|
+
exports.clickElementsAndInterceptNavigationRequests = clickElementsAndInterceptNavigationRequests;
|
|
123
|
+
/**
|
|
124
|
+
* @ignore
|
|
125
|
+
*/
|
|
126
|
+
function createInterceptRequestHandler(page, requests) {
|
|
127
|
+
return async function onInterceptedRequest(route, request) {
|
|
128
|
+
if (!isTopFrameNavigationRequest(page, request))
|
|
129
|
+
return route.continue();
|
|
130
|
+
requests.add(JSON.stringify({
|
|
131
|
+
url: request.url(),
|
|
132
|
+
headers: request.headers(),
|
|
133
|
+
method: request.method(),
|
|
134
|
+
payload: request.postData() ?? undefined,
|
|
135
|
+
}));
|
|
136
|
+
if (request.redirectedFrom()) {
|
|
137
|
+
return route.fulfill({ body: '' }); // Prevents 301/302 redirect
|
|
138
|
+
}
|
|
139
|
+
return route.abort('aborted'); // Prevents navigation
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @ignore
|
|
144
|
+
*/
|
|
145
|
+
function createTargetCreatedHandler(requests) {
|
|
146
|
+
return async function onTargetCreated(popup) {
|
|
147
|
+
const url = popup.url();
|
|
148
|
+
requests.add(JSON.stringify({ url }));
|
|
149
|
+
// We want to close the page but don't care about
|
|
150
|
+
// possible errors like target closed.
|
|
151
|
+
try {
|
|
152
|
+
await popup.close();
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
log.debug('enqueueLinksByClickingElements: Could not close spawned page.', { error: err.stack });
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @ignore
|
|
161
|
+
*/
|
|
162
|
+
function isTopFrameNavigationRequest(page, req) {
|
|
163
|
+
return req.isNavigationRequest()
|
|
164
|
+
&& req.frame() === page.mainFrame();
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @ignore
|
|
168
|
+
*/
|
|
169
|
+
function createFrameNavigatedHandler(page, requests) {
|
|
170
|
+
return function onFrameNavigated(frame) {
|
|
171
|
+
if (frame !== page.mainFrame())
|
|
172
|
+
return;
|
|
173
|
+
const url = frame.url();
|
|
174
|
+
requests.add(JSON.stringify({ url }));
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @ignore
|
|
179
|
+
*/
|
|
180
|
+
async function preventHistoryNavigation(page) {
|
|
181
|
+
/* istanbul ignore next */
|
|
182
|
+
return page.evaluate(() => {
|
|
183
|
+
window.__originalHistory__ = window.history;
|
|
184
|
+
delete window.history; // Simple override does not work.
|
|
185
|
+
window.history = {
|
|
186
|
+
stateHistory: [],
|
|
187
|
+
length: 0,
|
|
188
|
+
state: {},
|
|
189
|
+
go() { },
|
|
190
|
+
back() { },
|
|
191
|
+
forward() { },
|
|
192
|
+
pushState(...args) {
|
|
193
|
+
this.stateHistory.push(args);
|
|
194
|
+
},
|
|
195
|
+
replaceState(...args) {
|
|
196
|
+
this.stateHistory.push(args);
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/* istanbul ignore next */
|
|
202
|
+
/**
|
|
203
|
+
* In-browser script for updating element's CSS to make it reachable by mouse.
|
|
204
|
+
*/
|
|
205
|
+
function updateElementCssToEnableMouseClick(el, zIndex) {
|
|
206
|
+
const casted = el;
|
|
207
|
+
casted.style.visibility = 'visible';
|
|
208
|
+
casted.style.display = 'block';
|
|
209
|
+
casted.style.position = 'fixed';
|
|
210
|
+
casted.style.zIndex = String(zIndex);
|
|
211
|
+
casted.style.left = '0';
|
|
212
|
+
casted.style.top = '0';
|
|
213
|
+
const boundingRect = casted.getBoundingClientRect();
|
|
214
|
+
if (!boundingRect.height)
|
|
215
|
+
casted.style.height = '10px';
|
|
216
|
+
if (!boundingRect.width)
|
|
217
|
+
casted.style.width = '10px';
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Click all elements matching the given selector. To be able to do this using
|
|
221
|
+
* Playwright's `.click()` we need to make sure the elements are reachable by mouse,
|
|
222
|
+
* so we first move them to the top of the page's stacking context and then click.
|
|
223
|
+
* We do all in series to prevent elements from hiding one another. Therefore,
|
|
224
|
+
* for large element sets, this will take considerable amount of time.
|
|
225
|
+
* @ignore
|
|
226
|
+
*/
|
|
227
|
+
async function clickElements(page, selector, clickOptions) {
|
|
228
|
+
const elementHandles = await page.$$(selector);
|
|
229
|
+
log.debug(`enqueueLinksByClickingElements: There are ${elementHandles.length} elements to click.`);
|
|
230
|
+
let clickedElementsCount = 0;
|
|
231
|
+
let zIndex = STARTING_Z_INDEX;
|
|
232
|
+
let shouldLogWarning = true;
|
|
233
|
+
for (const handle of elementHandles) {
|
|
234
|
+
try {
|
|
235
|
+
await handle.evaluate(updateElementCssToEnableMouseClick, zIndex++);
|
|
236
|
+
await handle.click(clickOptions);
|
|
237
|
+
clickedElementsCount++;
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
const e = err;
|
|
241
|
+
if (shouldLogWarning && e.stack.includes('is detached from document')) {
|
|
242
|
+
log.warning(`An element with selector ${selector} that you're trying to click has been removed from the page. `
|
|
243
|
+
+ 'This was probably caused by an earlier click which triggered some JavaScript on the page that caused it to change. '
|
|
244
|
+
+ 'If you\'re trying to enqueue pagination links, we suggest using the "next" button, if available and going one by one.');
|
|
245
|
+
shouldLogWarning = false;
|
|
246
|
+
}
|
|
247
|
+
log.debug('enqueueLinksByClickingElements: Click failed.', { stack: e.stack });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
log.debug(`enqueueLinksByClickingElements: Successfully clicked ${clickedElementsCount} elements out of ${elementHandles.length}`);
|
|
251
|
+
}
|
|
252
|
+
exports.clickElements = clickElements;
|
|
253
|
+
/**
|
|
254
|
+
* This function tracks whether any requests, frame navigations or targets were emitted
|
|
255
|
+
* in the past idleIntervalMillis and whenever the interval registers no activity,
|
|
256
|
+
* the function returns.
|
|
257
|
+
*
|
|
258
|
+
* It will also return when a final timeout, represented by the timeoutMillis parameter
|
|
259
|
+
* is reached, to prevent blocking on pages with constant network activity.
|
|
260
|
+
*
|
|
261
|
+
* We need this to make sure we don't finish too soon when intercepting requests triggered
|
|
262
|
+
* by clicking in the page. They often get registered by the Node.js process only some
|
|
263
|
+
* milliseconds after clicking and we would lose those requests. This is especially prevalent
|
|
264
|
+
* when there's only a single element to click.
|
|
265
|
+
* @ignore
|
|
266
|
+
*/
|
|
267
|
+
async function waitForPageIdle({ page, waitForPageIdleMillis, maxWaitForPageIdleMillis }) {
|
|
268
|
+
return new Promise((resolve) => {
|
|
269
|
+
let timeout;
|
|
270
|
+
let maxTimeout;
|
|
271
|
+
page.on('popup', activityHandler);
|
|
272
|
+
function activityHandler() {
|
|
273
|
+
clearTimeout(timeout);
|
|
274
|
+
timeout = setTimeout(() => {
|
|
275
|
+
clearTimeout(maxTimeout);
|
|
276
|
+
finish();
|
|
277
|
+
}, waitForPageIdleMillis);
|
|
278
|
+
}
|
|
279
|
+
function maxTimeoutHandler() {
|
|
280
|
+
log.debug(`enqueueLinksByClickingElements: Page still showed activity after ${maxWaitForPageIdleMillis}ms. `
|
|
281
|
+
+ 'This is probably due to the website itself dispatching requests, but some links may also have been missed.');
|
|
282
|
+
finish();
|
|
283
|
+
}
|
|
284
|
+
function finish() {
|
|
285
|
+
page.off('request', activityHandler)
|
|
286
|
+
.off('framenavigated', activityHandler)
|
|
287
|
+
.off('popup', activityHandler);
|
|
288
|
+
resolve();
|
|
289
|
+
}
|
|
290
|
+
maxTimeout = setTimeout(maxTimeoutHandler, maxWaitForPageIdleMillis);
|
|
291
|
+
activityHandler(); // We call this once manually in case there would be no requests at all.
|
|
292
|
+
page.on('request', activityHandler);
|
|
293
|
+
page.on('framenavigated', activityHandler);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* @ignore
|
|
298
|
+
*/
|
|
299
|
+
async function restoreHistoryNavigationAndSaveCapturedUrls(page, requests) {
|
|
300
|
+
/* istanbul ignore next */
|
|
301
|
+
const state = await page.evaluate(() => {
|
|
302
|
+
const { stateHistory } = window.history;
|
|
303
|
+
window.history = window.__originalHistory__;
|
|
304
|
+
return stateHistory;
|
|
305
|
+
});
|
|
306
|
+
state.forEach((args) => {
|
|
307
|
+
try {
|
|
308
|
+
const stateUrl = args[args.length - 1];
|
|
309
|
+
const url = new url_1.URL(stateUrl, page.url()).href;
|
|
310
|
+
requests.add(JSON.stringify({ url }));
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
log.debug('enqueueLinksByClickingElements: Failed to ', { error: err.stack });
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=click-elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-elements.js","sourceRoot":"","sources":["../../../src/internals/enqueue-links/click-elements.ts"],"names":[],"mappings":";;;;AASA,8CAM0B;AAC1B,6DAA8B;AAE9B,oDAAoB;AAOpB,6BAA0B;AAE1B,MAAM,gBAAgB,GAAG,UAAU,CAAC;AACpC,MAAM,GAAG,GAAG,aAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC,CAAC;AAmIhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACI,KAAK,UAAU,8BAA8B,CAAC,OAA8C;IAC/F,IAAA,YAAE,EAAC,OAAO,EAAE,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC;QAC7B,IAAI,EAAE,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC;QAC3C,YAAY,EAAE,YAAE,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,YAAY,CAAC;QACjE,QAAQ,EAAE,YAAE,CAAC,MAAM;QACnB,YAAY,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,EAA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,0BAA0B;IAC1B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;QACnC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC,OAAiC,CAAC;QACjE,MAAgC,CAAC,OAAO,GAAI,MAAgC,CAAC,mBAAmB,CAAC;QAClG,OAAO,YAAY,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACnB,IAAI;YACA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAW,CAAC;YACjD,MAAM,GAAG,GAAG,IAAI,SAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC;YAC/C,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;SACzC;QAAC,OAAO,GAAG,EAAE;YACV,GAAG,CAAC,KAAK,CAAC,4CAA4C,EAAE,EAAE,KAAK,EAAG,GAAa,CAAC,KAAK,EAAE,CAAC,CAAC;SAC5F;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { BrowserCrawler, Configuration } from '@crawlee/browser';
|
|
|
6
6
|
import type { Dictionary } from '@crawlee/types';
|
|
7
7
|
import type { PlaywrightLaunchContext } from './playwright-launcher';
|
|
8
8
|
import type { DirectNavigationOptions, PlaywrightContextUtils } from './utils/playwright-utils';
|
|
9
|
-
export interface PlaywrightCrawlingContext<UserData extends Dictionary = Dictionary> extends BrowserCrawlingContext<Page, Response, PlaywrightController, UserData>, PlaywrightContextUtils {
|
|
9
|
+
export interface PlaywrightCrawlingContext<UserData extends Dictionary = Dictionary> extends BrowserCrawlingContext<PlaywrightCrawler, Page, Response, PlaywrightController, UserData>, PlaywrightContextUtils {
|
|
10
10
|
}
|
|
11
11
|
// @ts-ignore optional peer dependency
|
|
12
12
|
export interface PlaywrightHook extends BrowserHook<PlaywrightCrawlingContext, PlaywrightGotoOptions> {
|
|
@@ -82,6 +82,7 @@ export interface PlaywrightCrawlerOptions extends BrowserCrawlerOptions<Playwrig
|
|
|
82
82
|
* ```
|
|
83
83
|
* preNavigationHooks: [
|
|
84
84
|
* async (crawlingContext, gotoOptions) => {
|
|
85
|
+
* const { page } = crawlingContext;
|
|
85
86
|
* await page.evaluate((attr) => { window.foo = attr; }, 'bar');
|
|
86
87
|
* },
|
|
87
88
|
* ]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-crawler.d.ts","sourceRoot":"","sources":["../../src/internals/playwright-crawler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAsB,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC1H,OAAO,EAAE,cAAc,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGhG,MAAM,WAAW,yBAAyB,CAAC,QAAQ,SAAS,UAAU,GAAG,UAAU,CAAE,SACjF,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,sBAAsB;CAAG;
|
|
1
|
+
{"version":3,"file":"playwright-crawler.d.ts","sourceRoot":"","sources":["../../src/internals/playwright-crawler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,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;IAE9C;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;IAEtC;;;;;;;;;;;;;;OAcG;IACH,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC;IAAE,cAAc,EAAE,CAAC,gBAAgB,CAAC,CAAA;CAAE,EAAE,aAAa,EAAE,yBAAyB,CAAC;aAU7D,MAAM;IAT5E,iBAA0B,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAIpC;IAEF;;OAEG;gBACS,OAAO,GAAE,wBAA6B,EAAoB,MAAM,gBAAkC;cAmCrF,kBAAkB,CAAC,OAAO,EAAE,yBAAyB;cAMrD,kBAAkB,CAAC,eAAe,EAAE,yBAAyB,EAAE,WAAW,EAAE,uBAAuB;CAG/H;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,uDAE3G"}
|
|
@@ -80,6 +80,11 @@ class PlaywrightCrawler extends browser_1.BrowserCrawler {
|
|
|
80
80
|
throw new Error('PlaywrightCrawlerOptions.launchContext.proxyUrl is not allowed in PlaywrightCrawler.'
|
|
81
81
|
+ 'Use PlaywrightCrawlerOptions.proxyConfiguration');
|
|
82
82
|
}
|
|
83
|
+
// `browserPlugins` is working when it's not overriden by `launchContext`,
|
|
84
|
+
// which for crawlers it is always overriden. Hence the error to use the other option.
|
|
85
|
+
if (browserPoolOptions.browserPlugins) {
|
|
86
|
+
throw new Error('browserPoolOptions.browserPlugins is disallowed. Use launchContext.launcher instead.');
|
|
87
|
+
}
|
|
83
88
|
if (headless != null) {
|
|
84
89
|
launchContext.launchOptions ?? (launchContext.launchOptions = {});
|
|
85
90
|
launchContext.launchOptions.headless = headless;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-crawler.js","sourceRoot":"","sources":["../../src/internals/playwright-crawler.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAIpB,8CAAyE;AAGzE,+DAA2D;AAE3D,+DAAgF;
|
|
1
|
+
{"version":3,"file":"playwright-crawler.js","sourceRoot":"","sources":["../../src/internals/playwright-crawler.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAIpB,8CAAyE;AAGzE,+DAA2D;AAE3D,+DAAgF;AA0GhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAa,iBAAkB,SAAQ,wBAAgG;IAOnI;;OAEG;IACH,YAAY,UAAoC,EAAE,EAAoB,SAAS,uBAAa,CAAC,eAAe,EAAE;QAC1G,IAAA,YAAE,EAAC,OAAO,EAAE,0BAA0B,EAAE,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC,CAAC;QAE9F,MAAM,EACF,aAAa,GAAG,EAAE,EAClB,QAAQ,EACR,kBAAkB,GAAG,EAA0C,EAC/D,GAAG,qBAAqB,EAC3B,GAAG,OAAO,CAAC;QAEZ,IAAI,aAAa,CAAC,QAAQ,EAAE;YACxB,MAAM,IAAI,KAAK,CAAC,sFAAsF;kBAChG,iDAAiD,CAAC,CAAC;SAC5D;QAED,0EAA0E;QAC1E,sFAAsF;QACtF,IAAI,kBAAkB,CAAC,cAAc,EAAE;YACnC,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;SAC3G;QAED,IAAI,QAAQ,IAAI,IAAI,EAAE;YAClB,aAAa,CAAC,aAAa,KAA3B,aAAa,CAAC,aAAa,GAAK,EAAmB,EAAC;YACpD,aAAa,CAAC,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;SACnD;QAED,MAAM,kBAAkB,GAAG,IAAI,wCAAkB,CAAC,aAAa,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