我正在使用 node.js 和 puppeteer 来获取一些数据。我打开的一些文件非常大......然后我得到一个错误:
错误:
our error { TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
at Promise.then (/project/node_modules/puppeteer/lib/NavigatorWatcher.js:74:21)
at <anonymous> name: 'TimeoutError' }
如何忽略它或设置更高的超时时间?
这是我的脚本:
await page.goto('url'+tableCell04Val, {waitUntil: 'load'});
最佳答案
如果您正在加载一个沉重的页面,您可以使用 timeout: 0
来禁用超时错误。
在您的 page.goto
中使用它,例如:
await page.goto('url'+tableCell04Val, {waitUntil: 'load', timeout: 0});
关于javascript - Node.js puppeteer - 如何设置导航超时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52163547/