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

176
Views
How to find, sort and click on elem puppeteer?

I'm trying to find all "a" tag elements which attribute(href) contains part of the text "/groups/" and after click on it(one of them), and I want to exclude links which includes "/user/" text in attribute

I search for links like I show in the image

Here is my code example:

        const search = await this.page.$$eval('a[href^=\'/groups/\']', links => {
        return links
            .map(e => e.href)
            .filter(e => !e.getAttribute('href').includes('user'))
            .forEach((link, indx) => (indx === 2) && link.click() );
    });

But I've got an errors like:

Cannot read properties of undefined (reading 'getAttribute')

or

Cannot read properties of undefined (reading 'includes')

about 4 years ago · Santiago Gelvez
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!