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

245
Views
puppeteer.launch not loading

I am trying to open a page using puppeteer headless. However, puppeteer.launch is taking extremely long and the process isn't able to finish. Code:

const puppeteer = require("puppeteer");
async function getVisual() {
  try {
    const URL =
      "https://www.bannerbear.com/blog/ways-to-speed-up-puppeteer-screenshots/";
    const browser = await puppeteer.launch((headless = true), {
      ignoreDefaultArgs: ["--disable-extensions"],
      timeout: 3000,
    });
    const page = await browser.newPage();
    console.log("hi");

    await page.goto(url);
    await page.screenshot({ path: "screenshot.png" });
    await page.pdf({ path: "page.pdf" });

    await browser.close();
  } catch (error) {
    console.error(error);
  }
}

getVisual();
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In your puppeteer.launch() statement, you need to put those parameters in a single object.

Remove the "(headless = true)", and put it as a new item in the object. Like puppeteer.launch({headless: true, ignoreDefaultArgs: [], timeout: 3000})...

The documentation states how to use parameters here.

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