@crawlee/playwright 4.0.0-beta.103 → 4.0.0-beta.104
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.
|
@@ -25,7 +25,7 @@ declare class AdaptivePlaywrightCrawlerStatistics extends Statistics {
|
|
|
25
25
|
trackBrowserRequestHandlerRun(): void;
|
|
26
26
|
trackRenderingTypeMisprediction(): void;
|
|
27
27
|
}
|
|
28
|
-
export interface AdaptivePlaywrightCrawlerContext<UserData extends Dictionary =
|
|
28
|
+
export interface AdaptivePlaywrightCrawlerContext<UserData extends Dictionary = any> extends CrawlingContext<UserData> {
|
|
29
29
|
request: LoadedRequest<Request<UserData>>;
|
|
30
30
|
/**
|
|
31
31
|
* The HTTP response, either from the HTTP client or from the initial request from playwright's navigation.
|
|
@@ -8,11 +8,9 @@ import type { EnqueueLinksByClickingElementsOptions } from './enqueue-links/clic
|
|
|
8
8
|
import type { PlaywrightLaunchContext } from './playwright-launcher.js';
|
|
9
9
|
import type { BlockRequestsOptions, DirectNavigationOptions, HandleCloudflareChallengeOptions, InfiniteScrollOptions, InjectFileOptions, PlaywrightContextUtils, SaveSnapshotOptions } from './utils/playwright-utils.js';
|
|
10
10
|
export type PlaywrightGotoOptions = NonNullable<Parameters<Page['goto']>[1]>;
|
|
11
|
-
export interface PlaywrightCrawlingContext<UserData extends Dictionary =
|
|
12
|
-
}
|
|
13
|
-
// @ts-ignore optional peer dependency or compatibility with es2022
|
|
14
|
-
export interface PlaywrightHook extends BrowserHook<PlaywrightCrawlingContext> {
|
|
11
|
+
export interface PlaywrightCrawlingContext<UserData extends Dictionary = any> extends BrowserCrawlingContext<Page, Response, UserData, PlaywrightGotoOptions>, PlaywrightContextUtils {
|
|
15
12
|
}
|
|
13
|
+
export type PlaywrightHook<UserData extends Dictionary = any> = BrowserHook<PlaywrightCrawlingContext<UserData>>;
|
|
16
14
|
export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary<never>, ExtendedContext extends PlaywrightCrawlingContext = PlaywrightCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<PlaywrightCrawlingContext['request']>>> extends BrowserCrawlerOptions<Page, Response, PlaywrightCrawlingContext, ContextExtension, ExtendedContext, {
|
|
17
15
|
browserPlugins: [PlaywrightPlugin];
|
|
18
16
|
}, Routes> {
|
|
@@ -59,7 +57,7 @@ export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary<never>,
|
|
|
59
57
|
* ]
|
|
60
58
|
* ```
|
|
61
59
|
*/
|
|
62
|
-
preNavigationHooks?: BrowserHook<PlaywrightCrawlingContext
|
|
60
|
+
preNavigationHooks?: BrowserHook<PlaywrightCrawlingContext<GetUserDataFromRequest<ExtendedContext['request']>>, ContextExtension>[];
|
|
63
61
|
/**
|
|
64
62
|
* Async functions that are sequentially evaluated after the navigation. Good for checking if the navigation was successful.
|
|
65
63
|
* The function accepts `crawlingContext` as the only parameter. A hook may optionally return a partial object
|
|
@@ -76,7 +74,7 @@ export interface PlaywrightCrawlerOptions<ContextExtension = Dictionary<never>,
|
|
|
76
74
|
* ]
|
|
77
75
|
* ```
|
|
78
76
|
*/
|
|
79
|
-
postNavigationHooks?: BrowserHook<PlaywrightCrawlingContext
|
|
77
|
+
postNavigationHooks?: BrowserHook<PlaywrightCrawlingContext<GetUserDataFromRequest<ExtendedContext['request']>>, ContextExtension>[];
|
|
80
78
|
}
|
|
81
79
|
/**
|
|
82
80
|
* Provides a simple framework for parallel crawling of web pages
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/playwright",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.104",
|
|
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"
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@apify/datastructures": "^2.0.3",
|
|
51
51
|
"@apify/timeout": "^0.4.4",
|
|
52
|
-
"@crawlee/basic": "4.0.0-beta.
|
|
53
|
-
"@crawlee/browser": "4.0.0-beta.
|
|
54
|
-
"@crawlee/browser-pool": "4.0.0-beta.
|
|
55
|
-
"@crawlee/cheerio": "4.0.0-beta.
|
|
56
|
-
"@crawlee/core": "4.0.0-beta.
|
|
57
|
-
"@crawlee/types": "4.0.0-beta.
|
|
58
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
52
|
+
"@crawlee/basic": "4.0.0-beta.104",
|
|
53
|
+
"@crawlee/browser": "4.0.0-beta.104",
|
|
54
|
+
"@crawlee/browser-pool": "4.0.0-beta.104",
|
|
55
|
+
"@crawlee/cheerio": "4.0.0-beta.104",
|
|
56
|
+
"@crawlee/core": "4.0.0-beta.104",
|
|
57
|
+
"@crawlee/types": "4.0.0-beta.104",
|
|
58
|
+
"@crawlee/utils": "4.0.0-beta.104",
|
|
59
59
|
"cheerio": "^1.0.0",
|
|
60
60
|
"idcac-playwright": "^0.1.3",
|
|
61
61
|
"jquery": "^3.7.1",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "1c761e689e56ac06b67fc4f1dc091f693e024d12"
|
|
89
89
|
}
|