Bootstrap

python 爬虫 requests 错误汇总

1、发生异常: ProxyError

  • HTTPSConnectionPool(host=‘www.baidu.com’, port=443): Max retries exceeded with url: /s?ie=UTF-8&wd=free (Caused by ProxyError(‘Cannot connect to proxy.’, OSError(‘Tunnel connection failed: 407 Proxy Authentication Required’)))
    File “D:\github\python\jav_baidu_reptiles\text2.py”, line 53, in get_baidu_wd
    r = requests.get(
    File “D:\github\python\jav_baidu_reptiles\text2.py”, line 131, in
    get_baidu_wd(item,‘free’)
>-  原因分析:使用的代理有问题`Cannot connect to proxy`

2、ssl警告

  • C:\Users\wjt\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py:981: InsecureRequestWarning: Unverified HTTPS request is being made to host ‘1.199.6.141’. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/lates
;