- 修改爬虫配置文件,增加上传超时时间至 150000 毫秒,页面加载超时时间至 600000 毫秒,元素等待时间至 100000 毫秒,网络空闲时间至 50000 毫秒,重试延迟时间至 6000 毫秒 - 更新亚马逊爬虫的上传配置,超时时间调整为 600000 毫秒 - 将浏览器启动参数中的 headless 设置为 false,以便于调试和观察爬虫行为 - 这些更改旨在提高爬虫的稳定性和调试便利性master
@@ -8,7 +8,7 @@ module.exports = { | |||
upload: { | |||
url: 'https://apibase.sohomall.jp/uploaders', | |||
scene: 'goods', | |||
timeout: 30000 | |||
timeout: 30000 * 5 | |||
}, | |||
browser: { | |||
headless: true, | |||
@@ -29,13 +29,13 @@ module.exports = { | |||
variants: '.a-cardui-body #twister-plus-inline-twister > .a-section' | |||
}, | |||
timeouts: { | |||
pageLoad: 60000, | |||
elementWait: 10000, | |||
networkIdle: 5000 | |||
pageLoad: 600000, | |||
elementWait: 100000, | |||
networkIdle: 50000 | |||
}, | |||
retry: { | |||
maxAttempts: 3, | |||
delay: 2000 | |||
delay: 6000 | |||
}, | |||
headers: { | |||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', |
@@ -30,7 +30,7 @@ class AmazonCrawler extends BaseCrawler { | |||
this.uploadConfig = config.common?.upload || { | |||
url: 'https://apibase.sohomall.jp/uploaders', | |||
scene: 'goods', | |||
timeout: 30000 | |||
timeout: 600000 | |||
}; | |||
} | |||
@@ -20,7 +20,7 @@ class BaseCrawler { | |||
*/ | |||
async initBrowser() { | |||
this.browser = await chromium.launch({ | |||
headless: true, | |||
headless: false, | |||
args: ['--no-sandbox', '--disable-setuid-sandbox'] | |||
}); | |||
this.context = await this.browser.newContext({ |