Hi
I am trying to parse HTML in android from a webpage, and since the webpage it not well formed, I get SAXException.
Is there a way to parse HTML in android?
(my guess is not, so the follow up question is: what is the best way to do this? )
Thanks
Hi
I am trying to parse HTML in android from a webpage, and since the webpage it not well formed, I get SAXException.
Is there a way to parse HTML in android?
(my guess is not, so the follow up question is: what is the best way to do this? )
Thanks
There are many Java HTML parsers. Whether any work on Android, I can't say. I've seen people experiment with TagSoup, based on other posts here in SO.
Have you tried using Html.fromHtml(source)?
I think that class is pretty liberal with respect to source quality (it uses TagSoup internally, which was designed with real-life, bad HTML in mind). It doesn't support all HTML tags though, but it does come with a handler you can implement to react on tags it doesn't understand.
Html.fromHtml() supports only few tags.How to use the Handler according to you.Can u please explain with a sample code.
Regards,
vani
Maybe you can use WebView, but as you can see in the doc WebView doesn't support javascript and other stuff like widgets by default.
http://developer.android.com/reference/android/webkit/WebView.html
I think that you can enable javascript if you need it.