Parse HTML in Android -
I'm trying to parse HTML in the HTML from the webpage, and since it is not a well-formed webpage, I get
SAXException .
Is there a way to analyze HTML in Android?
I just had to face this problem. I tried some things but settled on using it. Jar is about 132, which is a bit bigger, but if you download the source and take some of the methods you will not use, then it is not big
=> Good thing about it That it will manage the badly created HTML
Here is a good example of their site.
file input = new file ("/tmp/input.html"); Document doc = jesop.fr (from input, "UTF-8", "http://example.com/"); //http://jsoup.org/cookbook/input/load-document-from-url/ Document Doc = Jsoup.connect ("http://example.com/") .get (); Element content = doc.getElementById ("content"); Element link = content.getElementsByTag ("a"); For (element link: links) {string linkHF = link.ttR ("href"); String link text = link.text (); }