2

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?

MariuszS
  • 30,646
  • 12
  • 114
  • 155
user1493834
  • 756
  • 4
  • 11
  • 25
  • what do you expect? what do you get instead? – eis Nov 16 '13 at 17:46
  • I am expecting start page of html should has but the document fetched has a start element .However, the document ends correctly with

    which is correct.

    – user1493834 Nov 17 '13 at 07:21

1 Answers1

3

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)

bMartyn
  • 31
  • 2