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
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