抓一个 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到我这的不要再去查了,我查了大约一小时。
[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到我这的不要再去查了,我查了大约一小时。
本文讨论了HTTP请求中页面大小限制的问题,详细解释了`maxBodySizeConnection`参数的作用及其默认值为1MB的原因。通过实例分析,帮助开发者理解如何调整此设置以解决页面抓取过程中遇到的问题。
870

被折叠的 条评论
为什么被折叠?



