开发者

android HTML parsing

开发者 https://www.devze.com 2023-02-19 14:26 出处:网络
how to par开发者_StackOverflow社区se HTML tag in android, file is stored in my local driveUse Jsoup. It supports selecting elements using CSS selectors. Start with this cookbook introduction.

how to par开发者_StackOverflow社区se HTML tag in android, file is stored in my local drive


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");
    // ...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消