Scraping Images from Gallery

I am trying to simply extract the images from a gallery. The problem is that if I only extract the thumbnails it is very poor quality. So I am trying to find a way for the scraper to click each thumbnail, then capture the main image. I am very new to this so I am a little lost in this regard. I have looked at other topics, but have not found a solution. Thank you for any help.

Url: https://www.homedepot.com/p/MOEN-Sleek-Single-Handle-Smart-Touchless-Pull-Down-Sprayer-Kitchen-Faucet-with-Voice-Control-and-Power-Clean-in-Stainless-7864EVSRS/312641585

Current Sitemap: this opens the gallery and captures the thumbnails - {"_id":"Homedepot2","startUrl":["https://www.homedepot.com/"],"selectors":[{"id":"clickimage","paginationType":"auto","parentSelectors":["_root","clickimage"],"selector":"span.mediagallery__thumbnailicons--count","type":"SelectorPagination"},{"id":"thumbnails","multiple":true,"parentSelectors":["clickimage"],"selector":".overlay__side-content__product-images img","type":"SelectorImage"}]}

try this sitemap:

{"_id":"homedepot","startUrl":["https://www.homedepot.com/p/MOEN-Sleek-Single-Handle-Smart-Touchless-Pull-Down-Sprayer-Kitchen-Faucet-with-Voice-Control-and-Power-Clean-in-Stainless-7864EVSRS/312641585#overlay"],"selectors":[{"clickActionType":"real","clickElementSelector":"button.thumbnail__image-block","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickMore","delay":500,"discardInitialElements":"discard-when-click-element-exists","id":"click","multiple":true,"parentSelectors":["_root"],"selector":"body","type":"SelectorElementClick"},{"extractAttribute":"src","id":"img","multiple":false,"parentSelectors":["click"],"selector":"div.main-asset__normal-image-wrapper img.stretchy","type":"SelectorElementAttribute"}]}

Thank you for the reply, but this sitemap doesn't seem to do anything when testing.

Hi, I would recommend scraping the thumbnails with the sitemap below and then using find&replace to replace 145 with 1000 in the URLs to get the high res images:

{"_id":"homedepot3","startUrl":["https://www.homedepot.com/p/MOEN-Sleek-Single-Handle-Smart-Touchless-Pull-Down-Sprayer-Kitchen-Faucet-with-Voice-Control-and-Power-Clean-in-Stainless-7864EVSRS/312641585#overlay"],"selectors":[{"id":"images","multiple":true,"parentSelectors":["click-gallery"],"selector":".thumbnail__wrapper img","type":"SelectorImage"},{"clickActionType":"real","clickElementSelector":".mediagallery__mainimage--clickable","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","id":"click-gallery","multiple":false,"parentSelectors":["_root"],"selector":".overlay__side-content__product-images","type":"SelectorElementClick"}]}

This actually fixed another issue i had that I hadn't asked about yet. you answered my other question as well. you have saved me a lot of time. thank you so much

1 Like