I am trying to save the picture from a link. I am reading the Url from the csv file one after another and trying to retrieve from the url and saving it in my local folder.
But after 6000 hit, python code is just hanging. It is not giving me any exception. I don't know what to do.
This is my code snippet:
img_path = eachrow[11]
try:
print("Image url ::" +baseURL+img_path)
opener = urllib.request.build_opener()
opener.addheaders = [('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1941.0 Safari/537.36')]
urllib.request.install_opener(opener)
urllib.request.urlretrieve(baseURL+img_path, image_file_path + img_path)
except Exception as e:
print(e)
img_path = "No image"