Hi I'm using the following code to scrape a product image on a website. But I can't figure out how to change the queryselector to scrape the image. For input please use the following url: https://my.supplychain.nhs.uk/Catalo...riteId=&Query= The url will be combined with the product id in the spreadsheet and then it will search for the image based on the queryselector. So I want to scrape the image from this part of the html code. <div class="productPrevImgThumb"> <a href="/Catalogue/product/fvk216" class="product_thumbnail_preview"> <img src="https://media.supplychain.nhs.uk/media/images/FVK216/thumb/764268_FVK216.jpg" alt="FVK216"> </a> </div> Anyone can help me modify the following code? Please Login or Register to view this content. Best regards Morten
Please Login or Register to view this content.
Last edited by morsoe; 05-02-2022 at 10:29 AM.
Please confirm that you are still using Excel 2003... or update your profile appropriately.
Glenn
My profile is now updated :-)
The solution was. imgUrl = doc.querySelector("div.productPrevImgThumb > a img").getAttribute("src")
There are currently 1 users browsing this thread. (0 members and 1 guests)
View Tag Cloud
Forum Rules
Bookmarks