0
我想存儲在ArrayList中的div內的p元素內部的文本。下面的HTML給出:如何使用Jsoup在ArrayList中的元素內存儲文本?
<div class="copy">
<p>First text</p>
<p>Second text</p>
<p>Third text</p>
</div>
我試着下面的代碼,但它加到上述所有並將其存儲爲一體的,而不是單獨存儲它們的:
Elements tips= doc.select("div.copy");
for(Element tip: tips) {
tipsArray.add(tip.text());
}
什麼我錯在這裏做什麼?謝謝。
謝謝。有效。 – 2014-09-02 07:04:58
@BidhanA很高興聽到它! – geoand 2014-09-02 07:06:29