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

本文讨论了HTTP请求中页面大小限制的问题,详细解释了`maxBodySizeConnection`参数的作用及其默认值为1MB的原因。通过实例分析,帮助开发者理解如何调整此设置以解决页面抓取过程中遇到的问题。
抓一个 2000KB左右的页面,老是抓一半,一开始以为是网络问题,然后以为是连接断了,最后实在没办法去读文档才发现原来默认最多是1MB。


[quote]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.[color=red] The default maximum is 1MB[/color]. 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[/quote]


希望google到我这的不要再去查了,我查了大约一小时。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值