Trying to grab the URLs or URL snippets of images from a webpage using Google Sheets IMPORTXML
function. I'm fairly sure I have the Xpath right, but I either get nothing or a "that data can't be parsed" - and yet I've seen other examples here of people grabbing URLs in Google Sheets this way, though in slightly different circumstances, none of which seem to be applicable here.
Trying to grab from this page - this is the relevant HTML:
<div id="product_image" class="A_ProductImg">
<div class="bx-wrapper" style="max-width: 100%;"><div class="bx-viewport" style="width: 100%; overflow: hidden; position: relative; height: 540px;"><ul class="A_ProductImgSlider" style="width: auto; position: relative;">
<li class="A_ItemList" style="float: none; list-style: none; position: absolute; width: 540px; z-index: 50; display: block;">
<div class="image A_ItemImg A_SquareOuter">
<img src="/ec/img/D3-64I011012_M_s.jpg" onerror="this.src='/ec/images/common/NoImage.gif'" alt="main product image" id="mainImage" class="A_ItemProductImg A_Square">
</div>
</li>
<li class="A_ItemList" style="float: none; list-style: none; position: absolute; width: 540px; z-index: 0; display: none;"><div class="image A_ItemImg A_SquareOuter"><img src="/ec/img/D3-64I011012_S_1m.jpg" alt="product image 1" class="A_ItemProductImg A_Square"></div></li>
<li class="A_ItemList" style="float: none; list-style: none; position: absolute; width: 540px; z-index: 0; display: none;"><div class="image A_ItemImg A_SquareOuter"><img src="/ec/img/D3-64I011012_S_2m.jpg" alt="product image 2" class="A_ItemProductImg
I've made the following query to try and work with the subsequent HTML:
=IMPORTXML(A2,"//*[@id='product_image']/div[1]/div[1]/ul/li[1]/div/img src")
A2 having the relevant URL.
I think the Xpath is correct there, but not sure why it won't give me the result I'm looking for. I've played around with it a bit, but no luck.