I have a Puppeteer script which loads a URL and then does something with the response. Sometimes the page times out, but I would like my script to continue with whatever the current state of the page is. I have already tried waitUntil: 'networkidle2'
, but sometimes it still times out.
Waiting until the load
isn't good enough because the images may not be loaded, and domcontentloaded
also doesn't work because the page may time out.
Ideally I could just use networkidle2
, up to a maximum of (say) 15 seconds, and if the page still hasn't loaded, just continue and use the page response as it is. Can this be done?
Thanks!