当前位置: 代码迷 >> JavaScript >> jsoup 默许抓取页面大小为1M
  详细解决方案

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

热度:716   发布时间:2014-01-05 18:22:55.0
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到我这的不要再去查了,我查了大约一小时。