Not Able To Parse Complete Html Of A Url Using Jsoup
Jsoup library is not parsing complete html of a given url. some divisions are missing from the orignial html of url. Interesting thing: http://facebook.com/search.php?init=s:email
Solution 1:
As far as i know Jsoup restricts the size of the retrieved content to 1M usually. Try this to get the full html source:
Document document = Jsoup.connect(url)
.userAgent("Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36")
.maxBodySize(0)
.get();
The maxBodySize(0)
removes the 1M limit.
There are other useful parameters you can set in the connect, like a timeout or cookies.
Post a Comment for "Not Able To Parse Complete Html Of A Url Using Jsoup"