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

97
Views
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
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!