Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python中的SSLError,已尝试验证=False_Python - Fatal编程技术网

Python中的SSLError,已尝试验证=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

我试图键入“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 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)