0
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)

I tried to type "verify = False" but it seemed not useful.

I used juypter and created python3 project to run this code. My python version are 2.7.13 and 3.4.3, but I can only create python3 with juypter, and I can't import "requests" under the version of 2.7.13.

Josh Yang
  • 5
  • 2
  • Maybe the same solution as this: [SSLError: sslv3 alert handshake failure](http://stackoverflow.com/questions/35405092/sslerror-sslv3-alert-handshake-failure)? – Vitaly May 11 '17 at 16:30
  • You could also try `pip install requests[security]`. [This](http://stackoverflow.com/a/31812342/3826759) answer talks about issues with SSL on OSX because of _ancient OpenSSL_. – double_j May 11 '17 at 17:29

0 Answers0