以前的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
否则会报错的
转自:http://blog.csdn.net/awj3584/article/details/38233293
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
否则会报错的
转自:http://blog.csdn.net/awj3584/article/details/38233293
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29802484/viewspace-2135129/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29802484/viewspace-2135129/