1. 程式人生 > >python爬蟲之requests對https的限制訪問

python爬蟲之requests對https的限制訪問

如果想要爬取的一個網站時返回錯誤如下:
/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79:InsecurePlatformWarning:
A true SSLContext object is not available.This prevents urllib3 from configuring SSL appropriately and may cause certain SSL
connections to fail.For more information, see https://urllib3.readthedocs.org/en/latest/security.html#
insecureplatformwarning.InsecurePlatformWarning


此時,執行此指令:

pip install pyopenssl ndg-httpsclient pyasn1

這種錯誤應該時因為python版本過低(比如python2.7),https的加密又無法被requests請求成功