看板 Python 關於我們 聯絡資訊
各位大大好 之前有用過一些版友寫的爬蟲 但是最近突然不能用了 都會跳出下面的錯誤訊息 File "C:\Python27\crawler.py", line 190, in <module> crawler() File "C:\Python27\crawler.py", line 56, in crawler cookies={'over18': '1'}, verify=True File "C:\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\api.py", line 69, in get return request('get', url, params=params, **kwargs) File "C:\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\api.py", line 50, in request response = session.request(method=method, url=url, **kwargs) File "C:\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\sessions.py", line 465, in request resp = self.send(prep, **send_kwargs) File "C:\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\sessions.py", line 573, in send r = adapter.send(request, **kwargs) File "C:\Python27\lib\site-packages\requests-2.7.0-py2.7.egg\requests\adapters.py", line 431, in send raise SSLError(e, request=request) requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error 上網查了一些文章 都說寫成verify=False這方法最快 但是我照這樣做仍然跑出一樣的錯誤訊息 請問各位大大我該怎麼做orz -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.167.42.171 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1486203285.A.046.html
shimachokong: 我也碰過,把requests的版本改成2.7.0就好了 02/04 18:56
shimachokong: 後來試過更後面的版本都會出現這種錯誤 02/04 18:57
shimachokong: 抱歉沒看清楚你的內容,我的是EOF occured in viola 02/04 19:02
shimachokong: tion of protocol 02/04 19:02
p2p8ppp: 我也以為是requests的問題 也換成2.7版本了 還是一樣 02/04 20:11
p2p8ppp: orz 02/04 20:11
p2p8ppp: 奇怪的是前一個月可以用 但是最近卻不行== 02/04 20:12
s860134: 你是用這個爬的嘛? 剛試沒遇到一樣的問題 02/04 21:05
p2p8ppp: 對 == 02/04 21:34
s860134: 你的 code 好像和 git 上的不同,requests 版本也比較舊 02/05 10:45
s860134: 要不嘗試更新看看 requests 和 crawler? 02/05 10:45
p2p8ppp: 好的我晚點試試看 02/05 15:37
p2p8ppp: 後來將PYTHON版本從2.7.0換成2.7.13就可以了感謝大大幫忙 02/06 15:14
ckc1ark: 應該是SNI py2.7.9+才支援 02/06 23:49