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

193
Views
How do i select <a> with aria-label in cheerio?

I am currently building a scraper which scrapes data from newspaper sites based on the keyword I am looking for, such as "environment" and "climate". But I have recently encountered a site where I couldn't simply check if the text has my desired keywords. Its HTML is written in this way

<a aria-label="Ravaged by floods, Bangladesh pitches plan to adapt to climate impacts" class="card-with-image-zoom" href="https://en.prothomalo.com/environment/climate-change/ravaged-by-floods-bangladesh-pitches-plan-to-adapt-to-climate-impacts">

Here is how i am looking for keywords using cheerio-

 const html = response.data;
            const $ = cheerio.load(html);
            const specificarticles = [];
$('a:contains("climate"),a:contains("environment")',HTML)

How do i check the keyword availability of this specific HTML using cheerio?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If it uses normal selectors, try

$("a[aria-label]") 

for all and

$("a[aria-label*=Bangladesh]") 

for example to get one with the word Bangladesh in it

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