androidparsinghtmlcleaner

Parse "div" which have no name or id , only class atrribute , with htmlClener in android


I am trying to parse the HTML webpage which have the div elements with the only class attribute. I need to extract information from it. It is multiple div element with so i need to traverse through DOM. But I can't identify the div element.


Solution

  • Switch to Jsoup, It's really awesome!

    In my opinion you should use . It is Java HTML parser. Its feature is listed below.

    For example you want to get a DIV elements with class foo

    Document doc = Jsoup.connect("http://website.com/").get();
    Elements divs = doc.select("div.foo");