为了账号安全,请及时绑定邮箱和手机立即绑定

print( len(response2.read()))一会好一会报错

正常结果

第一种方法

200

98028

报错


200

Traceback (most recent call last):

  File "D:\Program Files\Python35\lib\http\client.py", line 546, in _readall_chunked

    value.append(self._safe_read(chunk_left))

  File "D:\Program Files\Python35\lib\http\client.py", line 594, in _safe_read

    raise IncompleteRead(b''.join(s), amt)

http.client.IncompleteRead: IncompleteRead(9849 bytes read, 3009 more expected)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "D:\Code\eclipse\spider\test\test_urllib.py", line 9, in <module>

    print( len(response1.read()) )

  File "D:\Program Files\Python35\lib\http\client.py", line 440, in read

    return self._readall_chunked()

  File "D:\Program Files\Python35\lib\http\client.py", line 550, in _readall_chunked

    raise IncompleteRead(b''.join(value))

http.client.IncompleteRead: IncompleteRead(85170 bytes read)


正在回答

1 回答

就比如我们正常打开网页的时候也会报错,可能和你网速有关,也可以是服务端处理请求有关

0 回复 有任何疑惑可以回复我~
#1

scylhy 提问者

非常感谢!谢谢
2016-02-16 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Python开发简单爬虫
  • 参与学习       227670    人
  • 解答问题       1219    个

本教程带您解开python爬虫这门神奇技术的面纱

进入课程

print( len(response2.read()))一会好一会报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信