以前的python2.x的时候:
try:
fp=urllib.request.urlopen(blogurl)
except Exception, e:
print (e)
print(‘download exception %s‘ % blogurl)
return 0
现在python3.x的时候:
try:
fp=urllib.request.urlopen(blogurl)
except Exception as e:
print (e)
print(‘download exception %s‘ % blogurl)
return 0
否则会报错的
时间: 2024-10-07 06:55:30