问题:(爬虫)使用jsonpath报错requests.exceptions.ConnectionError: [Errno -3] Temporary failure...

想要获取拉钩网站上的地区的内容,并且配好了headers

报错内容如下:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.lagou.com', port=80): Max retries exceeded with url: /lbs/getAllCitySearchLabels.json (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fad76a08a58>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

在百度后找到了,一个相关问题的答案,然后尝试了一下,结果还是这个错误

紧接着发现了,虚拟机网络没有通,关机重启,网络通了,就好了~~~,也就是说

使用requests时,遇到这种错误类型的时候,就检查一下自己的网络是否通!!!

猜你喜欢

转载自blog.csdn.net/CaoMei_HuaCha/article/details/84787461