I'm running puppeteer
in an alpine-chrome
container with sandboxing, everything is done exactly as the docs suggest. And I've created a whole bunch of different puppeteer-fueled servers.
I'm launching Puppeteer without any arguments, except headless: false
.
Why is await page.goto()
method so problematic? It keeps giving me all kinds of non-sensical problems.
I'm always doing this:
await page.goto('https://my-url.com/something', {
waitUntil: 'networkidle2',
timeout: 0
})
Right now it just randomly hangs. Nothing happens, code execution just stops there. All I see is that CPU utilization hits the roof and then down to slightly-elevated levels, comparing to the properly-ongoing execution. 90% of time the goto
doesn't elevate CPU utilization at all. Same page, same server, hangs randomly within the same script execution.
Why is this hapening? Do I have to put setTimeout
and try-catch
statements all over my code around each page.goto()
method? It feels like I'm using puppeteer
fundamentally incorrect, because this behaviour doesn't make sense.
Sorry for vague question, I don't understand what kind of information would be helpful here.