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

116
Views
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
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!