问题: Python爬虫爬资源时由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。怎么破?
描述:
craw 59 : http://www.sz.gov.cn/cn/xxgk/zfxxgj/tzgg/201701/t20170106_5866245.htm
craw 60 : http://www.sz.gov.cn/cn/xxgk/zfxxgj/tzgg/201701/t20170106_5866315.htm
Traceback (most recent call last):
File "C:\Users\向晓宇\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\connection.py", line 138, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "C:\Users\向晓宇\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\util\connection.py", line 98, in create_connection
raise err
File "C:\Users\向晓宇\AppData\Local\Programs\Python\Python35\lib\site-packages\requests\packages\urllib3\util\connection.py", line 88, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] 由于连接方在一段时间后