I am trying to extract an image URL from a div, where the link to the file is stored as a json object in data-settings attribute:
<div class="c-offerBox_galleryItem">
<div data-component="magnifier" data-component-on="@load" data-settings="{
image: '/media/cache/gallery/rc/p2vgiqwd/images/42/42542/KRHE7Z29X19.jpg',
ratio: 1.5,
outside: 0
}"></div>
</div>
Currently I can access data-settings with:
xidel "https://example.com" -e "//div[@class='c-offerBox_galleryItem']/div/@data-setting
The output is the json object. How can I access the image object?
I thought something like:
xidel "https://example.com" -e "//div[@class='c-offerBox_galleryItem']/div/@data-setting/$json/image
would work, but not.