我有这段代码试图从给定的URL获取页面内容。
import httplib2
start_url = "https://www.somesite.com"
http = httplib2.Http(disable_ssl_certificate_validation=True)
status, response = http.request(start_url)
然而,当我运行它时,我收到此错误:
Traceback (most recent call last): File "C:\Documents and Settings\DD\Desktop\crawler.py", line 15, in <module>
resp, content = h.request(start_url, "GET") File "C:\Python27\lib\site-packages\httplib2-0.9-py2.7.egg\httplib2\__init__.py", line 1593, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "C:\Python27\lib\site-packages\httplib2-0.9-py2.7.egg\httplib2\__init__.py", line 1335, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers) File "C:\Python27\lib\site-packages\httplib2-0.9-py2.7.egg\httplib2\__init__.py", line 1257, in _conn_request
conn.connect() File "C:\Python27\lib\site-packages\httplib2-0.9-py2.7.egg\httplib2\__init__.py", line 1044, in connect
raise SSLHandshakeError(e) httplib2.SSLHandshakeError: [Errno 1] _ssl.c:510: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac
正如您可能已经看到的那样,我尝试禁用ssl验证但没有succsess。 任何帮助? 谢谢!
答案 0 :(得分:1)
SSL3_GET_RECORD:解密失败或错误记录mac
这与SSL验证无关。可能是服务器根本不会与SSL通信,或者存在其他与SSL相关的问题,但在此通信阶段,验证不是其中之一。
如果您提供真实的URL或完整的数据包捕获(文件或在cloudshark.org),可以更详细地分析信息。