Traceback (most recent call last):
File "C:\Py\G_new04.py", line 36, in <module>
html = response.read().decode('utf-8')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 467, in read
s = self._safe_read(self.length)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 608, in _safe_read
data = self.fp.read(amt)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
html = response.read().decode('utf-8')
这一行报错的,为什么read()会出现TimeoutError的报错,read方法需要连接主机吗?
谢谢