Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
How to reload a page using puppeteer(if page doesn't load only)

Most of the time I launch my automated bot it stucks at the beginning due to network issues,so when I reload it,It works.I want my bot to do this if the page doesn't load

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your page request isn't responded or the response isn't success with status 200 OK.
So maybe you want to get the page requested again if the response isn't OK.
These below lines will try to reload the page until it's status is 200 OK.

const gotoHome = async () => {
    try {
        let response
        do {
            response = await page.goto('https://www.google.com', {
                timeout: 0,
                waitUntil: 'load'
            })
        } while (response.status() !== 200)
    } catch (error) {
        (async () => await bot.gotoHome())()
    }
}

Please accept my answer as right if this help you.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda