Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

815
Visualizações
Node.js puppeteer - How to set navigation timeout?

I'm using node.js and puppeteer to get some data. Some of the files I'm opening are quite large ... and then I get an error:

Error:

our error { TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    at Promise.then (/project/node_modules/puppeteer/lib/NavigatorWatcher.js:74:21)
    at <anonymous> name: 'TimeoutError' }

How can I ignore it or set a higher timeout?

That's my script:

await page.goto('url'+tableCell04Val, {waitUntil: 'load'});
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

You can use timeout: 0 to disable timeout errors if you're loading a heavy page.

Use it in your page.goto like:

await page.goto('url'+tableCell04Val, {waitUntil: 'load', timeout: 0});

You can see the PR made to Pupeteer here which added the change, along with documentation and the unit tests that implement it.

over 4 years ago · Santiago Trujillo Relatório

0

#UPDATE 2019

You can also change the page behaviour since V1.0.0:

page.setDefaultNavigationTimeout(0); 

The param is the timeout in milliseconds.

References: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagesetdefaultnavigationtimeouttimeout

https://pptr.dev/#?product=Puppeteer&show=api-pagesetdefaultnavigationtimeouttimeout

over 4 years ago · Santiago Trujillo Relatório

0

There are two methods to handle the timeouts in Puppeteer:

a) page.setDefaultNavigationTimeout(timeoutInMiliseconds)

It affects the navigation-related functions:

•   page.goBack([options])
•   page.goForward([options])
•   page.goto(url[, options])
•   page.reload([options])
•   page.setContent(html[, options])
•   page.waitForNavigation([options])

b) page.setDefaultTimeout(timeoutInMiliseconds)

It affects all the previous navigation functions plus all the Waiting funtions:

•   page.waitFor(selectorOrFunctionOrTimeout[, options[, ...args]])
•   page.waitForFunction(pageFunction[, options[, ...args]])
•   page.waitForRequest(urlOrPredicate[, options])
•   page.waitForResponse(urlOrPredicate[, options])
•   page.waitForSelector(selector[, options])
•   page.waitForXPath(xpath[, options])

NOTE: page.setDefaultNavigationTimeout takes priority over page.setDefaultTimeout

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda