Python使用urllib2出现incompleteread错误
a=urllib2.urlopen("http://XXXXXXXXXx");
html = a.read();
要抓取的网页过大时出现incompleteread错误。某外国博客认为应该是某种服务器端的响应不良。
解决方法:
换用urllib
即:
a=urllib.urlopen("http://XXXXXXXXXx");
html = a.read();
Python使用urllib2出现incompleteread错误
a=urllib2.urlopen("http://XXXXXXXXXx");
html = a.read();
要抓取的网页过大时出现incompleteread错误。某外国博客认为应该是某种服务器端的响应不良。
解决方法:
换用urllib
即:
a=urllib.urlopen("http://XXXXXXXXXx");
html = a.read();