Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!