@crawlee/playwright 3.17.1-beta.0 → 3.17.1-beta.1
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.
|
@@ -511,7 +511,9 @@ async function handleCloudflareChallenge(page, url, session, options = {}) {
|
|
|
511
511
|
});
|
|
512
512
|
options.isChallengeCallback ?? (options.isChallengeCallback = async () => {
|
|
513
513
|
return await page.evaluate(async () => {
|
|
514
|
-
|
|
514
|
+
// Cloudflare nests the ray ID under varying wrapper elements, so we match by descendants
|
|
515
|
+
// instead of a direct-child chain (e.g. a `.footer-wrapper` was inserted in between).
|
|
516
|
+
return !!document.querySelector('.footer .footer-inner .diagnostic-wrapper .ray-id');
|
|
515
517
|
});
|
|
516
518
|
});
|
|
517
519
|
const retryBlocked = async () => {
|
|
@@ -532,7 +534,10 @@ async function handleCloudflareChallenge(page, url, session, options = {}) {
|
|
|
532
534
|
log[logLevel](`Detected Cloudflare challenge at ${url}, trying to solve it. This can take up to ${10 + (options.sleepSecs ?? 10)} seconds.`);
|
|
533
535
|
const bb = await page
|
|
534
536
|
.evaluate(() => {
|
|
535
|
-
|
|
537
|
+
// Prefer the actual challenge widget (the box holding the Turnstile checkbox input);
|
|
538
|
+
// fall back to the first content div for older challenge layouts.
|
|
539
|
+
const div = document.querySelector('.main-content div:has(input[id^="cf-chl-widget-"])') ??
|
|
540
|
+
document.querySelector('.main-content div');
|
|
536
541
|
return div?.getBoundingClientRect();
|
|
537
542
|
})
|
|
538
543
|
.catch(() => undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/playwright",
|
|
3
|
-
"version": "3.17.1-beta.
|
|
3
|
+
"version": "3.17.1-beta.1",
|
|
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"
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"@apify/datastructures": "^2.0.0",
|
|
57
57
|
"@apify/log": "^2.4.0",
|
|
58
58
|
"@apify/timeout": "^0.3.1",
|
|
59
|
-
"@crawlee/browser": "3.17.1-beta.
|
|
60
|
-
"@crawlee/browser-pool": "3.17.1-beta.
|
|
61
|
-
"@crawlee/core": "3.17.1-beta.
|
|
62
|
-
"@crawlee/types": "3.17.1-beta.
|
|
63
|
-
"@crawlee/utils": "3.17.1-beta.
|
|
59
|
+
"@crawlee/browser": "3.17.1-beta.1",
|
|
60
|
+
"@crawlee/browser-pool": "3.17.1-beta.1",
|
|
61
|
+
"@crawlee/core": "3.17.1-beta.1",
|
|
62
|
+
"@crawlee/types": "3.17.1-beta.1",
|
|
63
|
+
"@crawlee/utils": "3.17.1-beta.1",
|
|
64
64
|
"cheerio": "1.0.0-rc.12",
|
|
65
65
|
"jquery": "^3.6.0",
|
|
66
66
|
"lodash.isequal": "^4.5.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "3d45254f3d305c58b097f3b73b290c09bc664fe6"
|
|
93
93
|
}
|