Python request.post不适用于某些站点

时间:2019-12-14 13:46:45

标签: python python-requests tls1.2

我正在尝试通过python登录到站点,但这是我得到的错误。

Traceback (most recent call last):
  File "send.py", line 19, in <module>
    requests.post('https://finnkino.fi')
  File "/Users/programming/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/Users/programming/Library/Python/2.7/lib/python/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/programming/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/programming/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/programming/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='finnkino.fi', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))

这仅在某些网站上发生。这是我的python脚本:

import requests

requests.post('https://finnkino.fi')

在诸如 google.com amazon.com 的网站上,我没有收到此错误。

0 个答案:

没有答案