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

177
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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