当前位置:   article > 正文

python requests get请求 超时_尝试在python中执行get请求时获取[Errno 110]“连接超时”...

python requests [errno 110] connection timed out

我可以在firefox浏览器中手动访问下面代码中提到的“URL”,并看到json响应如下:{

"version" : "1.0",

"email_address" : "xxxx@emailin.com"

}

但是当我试图用下面的代码获取请求时,我得到的是连接超时错误。import requests

URL='https://deviceconfig.pod1.pie.avatar.ext.hp.com/virtualprinter/v1/printers/emailaddress/AQAAAAFiGLv5GQAAAAGrHfgO'

proxies = {'http': '', 'https': ''}

headers={'User-Agent':'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'}

try:

r= requests.get(url=URL,proxies=proxies,verify=False,headers=headers)

print r.status_code

print r.content

except requests.exceptions.RequestException as e:

print e.message

Error :

HTTPSConnectionPool(host='deviceconfig.pod1.pie.avatar.ext.hp.com', port=443): Max retries exceeded with url: /virtualprinter/v1/printers/emailaddress/AQAAAAFiGLv5GQAAAAGrHfgO (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',))

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/102550
推荐阅读
相关标签
  

闽ICP备14008679号