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

211
Views
how to put a delay in this evaluate with puppeteer

I am trying to put a delay in this evaluate with puppeteer but I tried everything and didn't works, such as:

await page.waitForTimeout(1000);

or with:

setTimeout(() => { }, 1000);
                await page.evaluate(() => {
                    let elements = document.getElementsByClassName('button-text');
                    for (let element of elements) if (element.innerText == 'Add') element.click();
                })

I wanted it to be after every click like this example but it never works:

await page.evaluate(() => {
    let elements = document.getElementsByClassName('button-text');
    for (let element of elements)
        if (element.innerText == 'Add'){
            await page.waitForTimeout(1000);
            element.click();   
        }
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You want to do that outside of the browser context:

let elements = await page.$$eval('.button-text', els => els.filter(el => el.innerText === 'Add'))
for(let element of elements){
  await page.waitForTimeout(1000)
  await element.click()
}
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!