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

215
Views
Unable to get image src url with Cheerio

At the moment I am trying to get value in src= of

<div class="page-break no-gaps">
  <img id="image-0" src="https://foo.bar/image.jpg" class="wp-image" alt="Title">
</div>

with the following code:

getImageSrc(imageObj: Cheerio | undefined): string {
    let image
    image = imageObj?.attr('src')
    console.log(image)
}

selector code: chapterDetailsSelector = 'div.page-break > img'

However all I am getting is undefined

EDITED - add more context

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

0

View source html != what is fetched by cheerio

Seems like the image url is in attr('data-cfsrc') rather than attr('data') when fetched with cheerio

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!