(优发娱乐平台) 使用requests请求网页,遇到sslv3 alert handshake failure

Traceback most recent call last:
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 559, in urlopen

body=body, headers=headers

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 345, in _make_request

self._validate_connconn

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 782, in _validate_conn

conn.connect

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connection.py”, line 250, in connect

ssl_version=resolved_ssl_version

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/util/ssl_.py”, line 285, in ssl_wrap_socket

return context.wrap_socketsock, server_hostname=server_hostname

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py”, line 376, in wrap_socket

_context=self

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py”, line 747, in init

self.do_handshake

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py”, line 983, in do_handshake

self._sslobj.do_handshake

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py”, line 628, in do_handshake

self._sslobj.do_handshake

ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure _ssl.c:646

During handling of the above exception, another exception occurred:

Traceback most recent call last:
File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py”, line 370, in send

timeout=timeout

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py”, line 588, in urlopen

raise SSLErrore

requests.packages.urllib3.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure _ssl.c:646

During handling of the above exception, another exception occurred:

Traceback most recent call last:
File “/Users/zhangchenhui/GitHub/spiders/get_movie.py”, line 6, in <module>

wb_data = requests.geturl,header

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/api.py”, line 69, in get

return requestget, url, params=params, **kwargs

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/api.py”, line 50, in request

response = session.requestmethod=method, url=url, **kwargs

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py”, line 468, in request

resp = self.sendprep, **send_kwargs

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/sessions.py”, line 576, in send

r = adapter.sendrequest, **kwargs

File “/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/requests/adapters.py”, line 433, in send

raise SSLErrore, request=request

requests.exceptions.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure _ssl.c:646

发表评论

电子邮件地址不会被公开。 必填项已用*标注