Python中的SSLError,已尝试验证=False
我试图键入“verify=False”,但似乎没有用Python中的SSLError,已尝试验证=False,python,Python,我试图键入“verify=False”,但似乎没有用 我使用juypter并创建了python3项目来运行这段代码。我的python版本是2.7.13和3.4.3,但我只能使用juypter创建python3,并且我不能在2.7.13版本下导入“请求”。可能与此相同的解决方案:?您也可以尝试pip install requests[security]。answer讨论了OSX上SSL的问题,因为古老的OpenSSL。 import requests from bs4 import Beauti
我使用juypter并创建了python3项目来运行这段代码。我的python版本是2.7.13和3.4.3,但我只能使用juypter创建python3,并且我不能在2.7.13版本下导入“请求”。可能与此相同的解决方案:?您也可以尝试
pip install requests[security]
。answer讨论了OSX上SSL的问题,因为古老的OpenSSL。
import requests
from bs4 import BeautifulSoup
res = requests.get("https://www.ptt.cc/bbs/NBA/index4807.html", verify
= False)
soup = BeautifulSoup(res.text,"lxml")
soup
SSLError Traceback (most recent call
last)
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-
packages/requests/packages/urllib3/connectionpool.py in urlopen(self,
method, url, body, headers, retries, redirect, assert_same_host,
timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)