undefined

最近在學習 Python 爬文,依照下列書籍寫了簡易的爬文方式:

undefined

 

很快的遇到了第一個問題:

requests.exceptions.SSLError: HTTPSConnectionPool(host='auth.cht.com.tw', port=443): Max retries exceeded with url: /ldaps/...

搜尋了解法之後,發現 requests.get(url, 參數) 可下很多不同的參數來解決此問題,我遇到的問題只要把 line 4加上參數 verify=False 即可。

html = requests.get(url,verify=False)

 

代表 requests 忽略對 SSL 的驗證。

參考網址如下:

http://blog.csdn.net/win_turn/article/details/77142100

http://docs.python-requests.org/zh_CN/latest/user/advanced.html#ssl

 

 

arrow
arrow
    全站熱搜

    葛瑞斯肯 發表在 痞客邦 留言(0) 人氣()