I want to download total 60 image from this page https://hk.urbanoutfitters.com/en-hk/search?query=adidas&sortBy=bestMatch but only managed to download the first 12 images to the folder
I have tested on the site, the image will only be load when you scroll to the position. So what you need to do is to combine scroll function for the task. You can achieve by something like the following:
for i in range(1,61):
try:
# The Images loaded
image = driver.find_element_by_xpath(the_string)
urllib.request.urlretrieve(image.get_attribute("src"), path)
except:
# Image not yet load
driver.execute_script("window.scrollTo(0, some_number)")
image = driver.find_element_by_xpath(the_string)
urllib.request.urlretrieve(image.get_attribute("src"), path)