I've tried couple ways and none solved my problem. Here is my code:
for i in links.readlines():
try:
link = urlopen(i)
except (HTTPError, URLError) as e:
print(e.code)
else:
<Code Goes Here>
The error massage:
AttributeError: 'URLError' object has no attribute 'code'
I need to make two Error Handling on one exception, but the problem I can't call the HTTPError attribute, I can't call the first Exception Handling at least.