Image URL showing in Data Preview, but not on scraped file

Image url showing on data preview, but not found in the scraped file.

@webber
@viesturs
@Webby

Please help me guys.


Url: Online Food Shopping | Grocery Delivery | ASDA Groceries

Sitemap:
{"_id":"asda-organic","startUrl":["https://groceries.asda.com/cat/organic/1215686353386"],"selectors":[{"delay":0,"id":"sub-cat","multiple":true,"parentSelectors":["_root"],"selector":"a.organic-taxo-btn","type":"SelectorLink"},{"delay":0,"id":"sub-sub-cat","multiple":true,"parentSelectors":["sub-cat"],"selector":"a.asda-btn--light","type":"SelectorLink"},{"delay":0,"id":"product-link","multiple":true,"parentSelectors":["sub-sub-cat"],"selector":"[data-module-id='89f48dab-0e3f-4e2e-944e-add8f133a1f7'] a","type":"SelectorLink"},{"delay":0,"id":"Title","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":"h1","type":"SelectorText"},{"delay":0,"id":"Img","multiple":true,"parentSelectors":["product-link"],"selector":"div.product-detail-page__flyout-viewer","type":"SelectorElement"},{"delay":0,"id":"SKU","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":"span.pdp-main-details__product-code","type":"SelectorText"},{"delay":0,"id":"Stock","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":"span.asda-pill","type":"SelectorText"},{"delay":0,"id":"Price","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":"strong.pdp-main-details__price","type":"SelectorText"},{"delay":0,"id":"Weight","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":"div.pdp-main-details__weight","type":"SelectorText"},{"delay":0,"id":"Description","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":".pdp-main-details > div > div:nth-of-type(2)","type":"SelectorHTML"},{"delay":0,"id":"Description Text","multiple":false,"parentSelectors":["product-link"],"regex":"","selector":".pdp-main-details > div > div:nth-of-type(2)","type":"SelectorText"},{"delay":0,"id":"image1","multiple":false,"parentSelectors":["Img"],"selector":"img.asda-image-zoom__zoomed-image","type":"SelectorImage"}]}

@leemeng

please help me

For your "img" scraper, try using:

Type: Element attribute

Selector: div>div.asda-image-zoom__zoomed-image-container>picture.asda-image>img[class*='zoomed-image']

Attribute name: src

@leemeng

And how can I scrape the other images under the main image? Because by image selector it is missing some images.

Edit: sorry, I didn't read the solution by @leemeng before typing this. Here's a way to get the full size image from that selector.


If you look in the inspector while hovering over the preview, you'll see that a new element loads.

If you run the scraper and move the mouse back and forth over the preview image, your scraper works as intended, and gets the full size image.

Take a look at the URL for an image on the product page:

https://ui.assets-asda.com/dm/asdagroceries/5054781593515_T1?defaultImage=asdagroceries/noImage&resMode=sharp2&id=0GJSJ2&fmt=webp&dpr=off&fit=constrain,1&wid=256&hei=256

There's a ton of elements passed in the URL.
&resMode
&id
&fmt
&fit
etc....

We're interested in the last two, &wid and &hei. Width and height.
Just remove &hei and change &wid to 1080.

You can do this for your entire column in Excel with a formula. Or paste it into Word and use Replace with wildcards (&wid* to &wid=1080).