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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2021-09-22
  • 2021-10-02
  • 2021-08-22
猜你喜欢
  • 2022-12-23
  • 2021-06-16
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案