开发者

Getting the error text from `urllib2.urlopen`

I us开发者_StackOverflow中文版ed Python's urllib2.urlopen and got a 500 error from the server. How do I find the text of the error? I'm hoping that it has useful information.


from urllib2 import urlopen, HTTPError

try:
    f = urlopen(url)
except HTTPError, e:
    print(e.read())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜