@crawlee/playwright 4.0.0-beta.131 → 4.0.0-beta.133
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.
|
@@ -435,6 +435,9 @@ export class AdaptivePlaywrightCrawler extends BasicCrawler {
|
|
|
435
435
|
}
|
|
436
436
|
async teardown() {
|
|
437
437
|
await super.teardown();
|
|
438
|
+
// Mirrors the owned-only `initialize()` in `init()` - without this, the predictor we built keeps its
|
|
439
|
+
// PERSIST_STATE listener registered after the crawl and never gets a final write.
|
|
440
|
+
await this.#renderingTypePredictor.ifOwned((predictor) => predictor.teardown());
|
|
438
441
|
for (const hook of this.#teardownHooks) {
|
|
439
442
|
await hook();
|
|
440
443
|
}
|
|
@@ -33,6 +33,11 @@ export declare class RenderingTypePredictor implements IRenderingTypePredictor {
|
|
|
33
33
|
* Initialize the predictor by restoring persisted state.
|
|
34
34
|
*/
|
|
35
35
|
initialize(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Stop persisting the model, writing it out one last time. `initialize()` reopens the persistence window.
|
|
38
|
+
*/
|
|
39
|
+
teardown(): Promise<void>;
|
|
40
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
36
41
|
/**
|
|
37
42
|
* Predict the rendering type for a given URL and request label.
|
|
38
43
|
*/
|
|
@@ -87,6 +87,15 @@ export class RenderingTypePredictor {
|
|
|
87
87
|
async initialize() {
|
|
88
88
|
await this.state.initialize();
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Stop persisting the model, writing it out one last time. `initialize()` reopens the persistence window.
|
|
92
|
+
*/
|
|
93
|
+
async teardown() {
|
|
94
|
+
await this.state.teardown();
|
|
95
|
+
}
|
|
96
|
+
async [Symbol.asyncDispose]() {
|
|
97
|
+
await this.teardown();
|
|
98
|
+
}
|
|
90
99
|
/**
|
|
91
100
|
* Predict the rendering type for a given URL and request label.
|
|
92
101
|
*/
|
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.133",
|
|
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.133",
|
|
53
|
+
"@crawlee/browser": "4.0.0-beta.133",
|
|
54
|
+
"@crawlee/browser-pool": "4.0.0-beta.133",
|
|
55
|
+
"@crawlee/cheerio": "4.0.0-beta.133",
|
|
56
|
+
"@crawlee/core": "4.0.0-beta.133",
|
|
57
|
+
"@crawlee/types": "4.0.0-beta.133",
|
|
58
|
+
"@crawlee/utils": "4.0.0-beta.133",
|
|
59
59
|
"cheerio": "^1.0.0",
|
|
60
60
|
"jquery": "^3.7.1",
|
|
61
61
|
"ml-logistic-regression": "^2.0.0",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "ace617a523c893bf2eb1ac113412205fc05b2964"
|
|
88
88
|
}
|