关于requests.exceptions.ConnectionError: HTTPSConnectionPool的问题

错误如下:

    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='wwww.baidu.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001AEB4A86E48>: Failed to establish a new connection: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。'))

我爬的网站是百度,主要原因是百度做了反爬虫机制,因此需要把headers里面的key值都加上

上一篇:You should consider upgrading via the 'python -m pip install --upgrade pip' command.


下一篇:ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed