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

279
Views
How to scrape a particular element (Cheerio)

The website code is <div class="product__price product__price-promo "><del>16 999</del>15 999</div>

I need to scrape 15 999. How can I do this exactly?

I already tried to do it with selector div.product__price or product__price product__price-promo in which case I get the result "1699915999"

If I try with selector div.product__price > del get the result 16999.

So far I don't know how to get 15 999

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do:

const b = priceSelectors.map(sel => [...this._$(sel)[0].childNodes].find(n=>n.nodeType==3&&n.data.trim()).data.trim()).find(e=>e) || null;

This goes through the selectors and finds the content of the first non-whitespace text node.

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