[英]Getting the error text from `urllib2.urlopen`
我使用 Python 的urllib2.urlopen
並從服務器收到 500 錯誤。 如何找到錯誤的文本? 我希望它有有用的信息。
from urllib2 import urlopen, HTTPError
try:
f = urlopen(url)
except HTTPError, e:
print(e.read())
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.