Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 Jsoup,我想从 HTML 页面中提取所有段落,即介于<p>和之间的任何段落</p>。
<p>
</p>
我该如何做到这一点?
你能不能这样做:
myDocument.getElementsByTag('p')
JSoup getElementsByTag
然后,您可以遍历返回的元素并获取它们的数据/文本/自己的文本/您认为与您想做的最相关的任何内容。
JSoup 元素.text()