修改whatshub工单爬虫
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user