user1493834
user1493834

Reputation: 768

JSoup returning incomplete HTML document

I am trying to fetch a html doc using JSoup but it returns incomplete HTML.

Document doc = Jsoup.connect("http://stackoverflow.com/questions/79923");

what could be wrong?

Upvotes: 2

Views: 1105

Answers (1)

bMartyn
bMartyn

Reputation: 31

The maximum size of the document needs to be extended. By default it sets the max limit to 1MB. By setting it to 0 it will have an unlimited size.

Connection connection = Jsoup.connect(String url);
connection.maxBodySize(0);
Document doc = connection.get();

See the Jsoup documentation: http://jsoup.org/apidocs/org/jsoup/Connection.html#maxBodySize(int)

Upvotes: 3

Related Questions