We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ebc22c commit 11fe542Copy full SHA for 11fe542
src/index.js
@@ -74,9 +74,18 @@ async function analyze (originalUrl) {
74
domain: url.hostname
75
})
76
// https://github.com/puppeteer/puppeteer/blob/v2.1.0/docs/api.md#pagegotourl-options
77
- const response = await page.goto(originalUrl, {
78
- waitUntil: 'networkidle0'
79
- })
+ let response
+ try {
+ response = await page.goto(originalUrl, {
80
+ waitUntil: 'networkidle0',
81
+ timeout: 20000
82
+ })
83
+ } catch (err) {
84
85
+ waitUntil: 'domcontentloaded'
86
87
+ await page.waitForTimeout(10000)
88
+ }
89
if (!response.ok()) {
90
const error = new Error(`Website responded with ${response.status()} status code`)
91
error.code = ERROR_CODES.HTTP_ERROR
0 commit comments