修改whatshub工单爬虫

This commit is contained in:
root
2026-06-29 04:54:41 +08:00
parent 6130125427
commit 9f2e904fab
14 changed files with 1254 additions and 147 deletions
+8 -2
View File
@@ -28,6 +28,10 @@ function normalizeAntiBot(antiBot) {
solverFallback: antiBot.solverFallback !== false,
sessionKey: antiBot.sessionKey || '',
challengeTimeoutMs: antiBot.challengeTimeoutMs || 60000,
postCfReadyUrlContains: antiBot.postCfReadyUrlContains || '',
postCfReadySelector: antiBot.postCfReadySelector || '',
postCfReadyTimeoutMs: antiBot.postCfReadyTimeoutMs || 0,
postCfSettleMs: antiBot.postCfSettleMs || 0,
};
}
@@ -106,8 +110,10 @@ async function createManagedPage(browser, existingPage, options = {}) {
page.setDefaultNavigationTimeout(NAVIGATION_TIMEOUT_MS);
page.setDefaultTimeout(PAGE_DEFAULT_TIMEOUT_MS);
const userAgent = options.userAgent || DEFAULT_UA;
await page.setUserAgent(userAgent);
if (!options.skipUserAgent) {
const userAgent = options.userAgent || DEFAULT_UA;
await page.setUserAgent(userAgent);
}
if (options.viewport) await page.setViewport(options.viewport);
if (options.cookies && options.cookies.length > 0) {