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

112
Visualizações
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 à 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