Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda