I want to download all the jpg and png images from the website but I need them to download in order and maybe if it’s possible naming them during the download. For example download 1000 images, in order from 1 to 1000 with the name of order. For example 3rd picture will be named 3, or 300 picture will be named 300. I’m newbie in coding and I need this for my project. I can download them manually, but it will take time and I want to learn how to automate such process.
Advertisement
Answer
You may use the following approach
# IMPORT LIBRARIES # choose libraries to be used def download_images_from_url(url): count = 1 # initialize counter # loop # write code to download the image from website # write code to store it locally # rename the image using count variable count+=1 #update counter url = "https://www.website.com" download_images_from_url(url)