My all links are in working condition and I tested in browser still I am getting below errors while downloading images.
an error occurred while fetching: "http://epaperlokmat.in/eNewspaper/News/LOK/MULK/2020/04/29/20200429_1.jpeg"
an error occurred while fetching: "http://epaperlokmat.in/eNewspaper/News/LOK/MULK/2020/04/29/20200429_2.jpeg"
an error occurred while fetching: "http://epaperlokmat.in/eNewspaper/News/LOK/MULK/2020/04/29/20200429_3.jpeg"
an error occurred while fetching: "http://epaperlokmat.in/eNewspaper/News/LOK/MULK/2020/04/29/20200429_4.jpeg"
import urllib.request
from urllib.error import URLError # the docs say this is the base error you need to catch
import time
import datetime,time
from PIL import Image
start_time = time.time()
today=time.strftime("%Y%m%d")
m=today=time.strftime("%m")
d=today=time.strftime("%d")
Y=today=time.strftime("%Y")
A=today=time.strftime("%b")
for i in range(1,5):
issue_id1=str(i)
url = "http://epaperlokmat.in/eNewspaper/News/LOK/MULK/"+str(Y) +"/"+str(m)+"/"+str(d)+"/"+str(Y+m+d)+"_"+str(i)+".jpeg"
try:
s = urllib.request.urlopen(url)
contents = s.read()
except URLError:
print('an error occurred while fetching: "{}"'.format(url))
continue
file = open("D:/IMAGES/"+issue_id1+".jpeg", "wb")
file.write(contents)