【发布时间】:2017-09-25 18:03:32
【问题描述】:
是否可以通过知道前一个元素来使用 jSoup 获取后续元素?
例如在这个html中,我有表格“Given this item”的数据
我想获取包含“正在寻找这个”的下一个表
<table><tr><td>irrelevant info 1 <a href="http://jsoup.org/">jsoup</a></td></tr></table>
<p>there is a p here</p>
<table><tr><td>Given this item <a href="http://jsoup.org/">jsoup</a></td></tr></table>
<p>there is a p here</p>
<table><tr><td>Looking for this <a href="http://jsoup.org/">jsoup</a></td></tr></table>
<p>there is a p here</p>
<table><tr><td>irrelevant info 2<a href="http://jsoup.org/">jsoup</a></td></tr></table>
<p>there is a p here</p>
<table><tr><td>irrelevant info 3 <a href="http://jsoup.org/">jsoup</a></td></tr></table>
【问题讨论】:
标签: jsoup