开发者

Java HTML parsers modify page

开发者_StackOverflow社区

Is it possible to use some kind of an HTML parser with which I will choose information under which tag I want to display, and just clear all the rest?

I tried using Jsoup. Developing for android. durig selection my application crashes due to 'outofmemmoryerror'


You can extract portion of tag using JSoup and can separate it out

For Example :

String html = "<p>An <a href='http://example.com/'><b>example</b></a> link.</p>";
Document doc = Jsoup.parse(html);
Element link = doc.select("a").first();
String text = doc.body().text(); // "An example link" , and ignore the rest
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜