Navigation timed out after 60 seconds.
I'm scraping a website, if I run it in headless mode I get this error, if I run it headed I see the webpage completely loaded (the loading wheel still spins somehow).
this is my routes:
5 Replies
crawler config :
@NeoNomade What is the last log that you see how does the error looks like?
equal-aqua•3y ago
Was also dealing with this issue for a few sites today. Never really fixed it, but I tried to change the default confirmation of page load from "load" to "domcontentloaded" (first thing to fire) and that seemed to help for some pages:
preNavigationHooks: [
async (context, gotoOptions) => {
gotoOptions.waitUntil = "domcontentloaded";
},
],
I then also included this in my router:
let errorLoading = false;
try {
// try waiting until the network is idle or a max of 10 seconds until just moving on to get the text etc. this happens far more than I would have expected
await utils.puppeteer.gotoExtended(page, request, { waitUntil: 'networkidle2', timeout: 10000 });
} catch {
errorLoading = true;
log.error(`Waited 10 seconds for network to be more idle on ${request.loadedUrl} but never happened, moving on anyway with pulling html etc.`);
}
@companyData just advanced to level 2! Thanks for your contributions! 🎉
equal-aqua•3y ago
An example of one of the urls that was giving me trouble was: https://pezeshkanekhoob.com
پزشکان خوب
سایت نوبت دهی اینترنتی دکتر