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

188
Views
how do I use puppeteer to click 'I agree' button for google cookies

I am trying to use puppeteer to open google translate and enter text into the detect language field, and then return the result in English. However, I am falling at the first hurdle as the button below won't let me through. I know I can use page.click() but I cannot find a button ID and do not know how to click it otherwise.

screenshot of the button I need to click, and the results of inspecting it

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

One way would be to select the button using an XPath expression with contains() and then click it:

const [button] = await page.$x("//button[contains(., 'I agree')]");
if (!button) throw new Error("button not found");
await button.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!