开发者

extract paragraphs from HTML page

Using Jsoup, I want to extract all paragraphs from an HTML page, i.e. whatever is between <p> and </p>.

How do I accomplish th开发者_StackOverflow中文版is?


Can'y you just do:

myDocument.getElementsByTag('p') 

JSoup getElementsByTag

You can then iterate over the returned elements and get their data/text/ownText / whatever you think is most relevant for what you want to do.

JSoup Element.text()

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜