@crawlee/browser 3.16.1-beta.77 → 3.16.1-beta.78
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.
|
@@ -339,7 +339,7 @@ export declare abstract class BrowserCrawler<InternalBrowserPoolOptions extends
|
|
|
339
339
|
protected _handleNavigation(crawlingContext: Context): Promise<void>;
|
|
340
340
|
protected _applyCookies({ session, request, page, browserController }: Context, preHooksCookies: string, postHooksCookies: string): Promise<void>;
|
|
341
341
|
/**
|
|
342
|
-
* Marks session bad in
|
|
342
|
+
* Marks session bad on navigation timeout, and stops in-flight page loading on any navigation error.
|
|
343
343
|
*/
|
|
344
344
|
protected _handleNavigationTimeout(crawlingContext: Context, error: Error): Promise<void>;
|
|
345
345
|
/**
|
|
@@ -352,14 +352,16 @@ class BrowserCrawler extends basic_1.BasicCrawler {
|
|
|
352
352
|
.map((c) => ({ ...c, url: c.domain ? undefined : request.url })));
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
|
-
* Marks session bad in
|
|
355
|
+
* Marks session bad on navigation timeout, and stops in-flight page loading on any navigation error.
|
|
356
356
|
*/
|
|
357
357
|
async _handleNavigationTimeout(crawlingContext, error) {
|
|
358
|
-
const { session } = crawlingContext;
|
|
358
|
+
const { session, page } = crawlingContext;
|
|
359
359
|
if (error && error.constructor.name === 'TimeoutError') {
|
|
360
360
|
(0, basic_1.handleRequestTimeout)({ session, errorMessage: error.message });
|
|
361
361
|
}
|
|
362
|
-
|
|
362
|
+
// Fire-and-forget: no user code will run on this page after a failed navigation.
|
|
363
|
+
// Swallow rejections: the page may already be detached.
|
|
364
|
+
void page.evaluate(() => window.stop()).catch(() => { });
|
|
363
365
|
}
|
|
364
366
|
/**
|
|
365
367
|
* Transforms proxy-related errors to `SessionError`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/browser",
|
|
3
|
-
"version": "3.16.1-beta.
|
|
3
|
+
"version": "3.16.1-beta.78",
|
|
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"
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@apify/timeout": "^0.3.0",
|
|
57
|
-
"@crawlee/basic": "3.16.1-beta.
|
|
58
|
-
"@crawlee/browser-pool": "3.16.1-beta.
|
|
59
|
-
"@crawlee/types": "3.16.1-beta.
|
|
60
|
-
"@crawlee/utils": "3.16.1-beta.
|
|
57
|
+
"@crawlee/basic": "3.16.1-beta.78",
|
|
58
|
+
"@crawlee/browser-pool": "3.16.1-beta.78",
|
|
59
|
+
"@crawlee/types": "3.16.1-beta.78",
|
|
60
|
+
"@crawlee/utils": "3.16.1-beta.78",
|
|
61
61
|
"ow": "^0.28.1",
|
|
62
62
|
"tslib": "^2.4.0",
|
|
63
63
|
"type-fest": "^4.0.0"
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "c5afa13f7272fe18a2370c6c5abf20c2347a0874"
|
|
85
85
|
}
|