from: https://stackoverflow.com/questions/19370436/get-errno-from-python-requests-connectionerror

当使用:

try:

    request.get(url=url)

except RequestException as e:

    print e

    print e.args[0]

    print e.args[0].reason  # get from dir(e.args[0])

获取错误信息时,使用print e.args[0].reason

posted on 2017-08-29 09:28  Go_Forward  阅读(899)  评论(0编辑  收藏  举报