请求 SSLError: HTTPSConnectionPool(host='www.recruit.com.hk', port=443):url 超出最大重试次数



我对此感到非常困惑。

这是我正在使用的。

  • 请求2.18.4
  • Python 2.7.14

我正在构建刮板,并尝试使用requests.get()连接到URL。

这是从跳跃到另一个链接的链接。这是代码:

r = rqs.get('https://www.indeed.hk/rc/clk?jk=ab794b2879313f04&fccid=a659206a7e1afa15')

这是提出的错误:

File "/Users/cecilialee/anaconda/envs/py2/lib/python2.7/site-packages/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='www.recruit.com.hk', port=443): Max retries exceeded with url: /jobseeker/JobDetail.aspx?jobOrder=L04146652 (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))

设置verify = False不能解此错误。

我已经在线搜索,但找不到可以帮助解决我的问题的解决方案。谁能帮忙?

您可以使用http(而不是https)从网站获取信息。

>>> response = requests.get('http://www.recruit.com.hk')
>>> response.status_code
200
>>> len(response.text)

我尝试了您的代码,没关系:

>>> r = requests.get('https://www.indeed.hk/rc/clk?jk=ab794b2879313f04&fccid=a659206a7e1afa15')
>>> r.status_code
200
>>> len(r.text)
34272

我的环境:

Python 2.7.10请求== 2.5.0

最新更新