Android
Android

Reputation: 9023

android HTML parsing

how to parse HTML tag in android, file is stored in my local drive

Upvotes: 0

Views: 564

Answers (1)

BalusC
BalusC

Reputation: 1108642

Use Jsoup. It supports selecting elements using CSS selectors. Start with this cookbook introduction.

Kickoff example:

Document document = Jsoup.parse(new File("/foo.html"), "UTF-8");
Elements links = document.select("a");
for (Element link : links) {
    String url = link.absUrl("href");
    // ...
}

Upvotes: 1

Related Questions