ConnectionError: HTTPSConnectionPool(host=‘cq.feibaos.com’, port=443): Max retries exceeded with url: /news/lists-notice.html?req=t11-320100&word=&idx=49 (Caused by NewConnectionError(’<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc465493f10>: Failed to establish a new connection: [Errno -2] Name or service not known’))
使用session代替get
代码如下:
import requests
s=requests.session()
s.keep_alive=False
s.get(url=url)