首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

jsoup 默许抓取页面大小为1M

2014-01-05 
jsoup 默认抓取页面大小为1M抓一个 2000KB左右的页面,老是抓一半,一开始以为是网络问题,然后以为是连接断

jsoup 默认抓取页面大小为1M
抓一个 2000KB左右的页面,老是抓一半,一开始以为是网络问题,然后以为是连接断了,最后实在没办法去读文档才发现原来默认最多是1MB。


引用maxBodySize

Connection maxBodySize(int bytes)
Set the maximum bytes to read from the (uncompressed) connection into the body, before the connection is closed, and the input truncated. The default maximum is 1MB. A max size of zero is treated as an infinite amount (bounded only by your patience and the memory available on your machine).
Parameters:
bytes - number of bytes to read from the input before truncating
Returns:
this Connection, for chaining


希望google到我这的不要再去查了,我查了大约一小时。

热点排行