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

118
Vistas
Node js Use puppeteer synchronously

Hi i'm trying to use puppeteer synchronously but i'm getting an error when i try to access the click method on the page:

let _browser;
let _page;

    puppeteer
      .launch({ headless: false, defaultViewport: null })
      .then((browser) => (_browser = browser))
      .then((browser) => (_page = browser.newPage()))
      .then((page) => page.goto('https://instagram.com'))
      .then(() => _page)
      .then((page) =>  page.waitForTimeout(3000))
      .then((page) => page.click('button[class="aOOlW   HoLwm "]'))
      .then(() => _browser.close());

I get an error on button click (.then((page) => page.click('button[class="aOOlW HoLwm "]'))):

file:/index.js:38 .then((page) => page.click('button[class="aOOlW
HoLwm "]')) ^

TypeError: Cannot read properties of undefined (reading 'click') at file::/index.js:38:24

Is there a way to access the click method of page synchronously? Why am I getting that error?

about 4 years ago · Santiago Gelvez
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