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

109
Vistas
Puppeteer getting response from url pdf

I'. automating regression tests for a website and one of the tasks is to check the various urls that come in to me. I am using Puppeteer and Chromium for this. I get both web pages and pdf, when I get url pdf and try to enter it seems that nothing happens. I am getting a timeout error.

if(url.endsWith(".pdf") || page.url().indexOf("pdf")){
            context.log("is PDF");
              throw 422;
          }
         await page.goto(url).catch(e => {
            context.log('Navigation failed: ' + e.message)});

Yhis isn't enough, isn't there another way to handle the error without checking the url but acting on it? How do i handle this error? I would like to generate an error whenever I receive a pdf url (the link does not necessarily end with .pdf)

about 4 years ago · Juan Pablo Isaza
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