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

240
Vistas
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 Respuestas
Responde la pregunta

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 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