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

89
Visualizações
Puppeteer using window.find and clicking an element

I am trying to use puppeteer's window.find to search for some text on the webpage and in turn click on the found element. The window.find function works fine and highlights the relevant text however I am unsure how to click on the highlighted text after.

<a 
  class="govuk-link" 
  rel="nofollow" 
  href="/energy-certificate/4230-1322-4009-0714-2296"
> 
  Some Address
</a>

There is also the problem that there are multiple '''govuk-link''' on the webpage and it seems to click on the first one when referenced

if(const found = await page.evaluate(() => window.find("Some Address"))) {
  await page.waitForSelector('.govuk-link');
  await page.click('.govuk-link')
};

How do I click the link highlighted by window.find? I have also tried using XPath however have the same issue with multiple govuk-links

about 4 years ago · Juan Pablo Isaza
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