java jsoup:提取两个<img>
这是我的密码
<table width="100%" cellspacing="0" border="0" cellspadding="20">
<tbody>
<tr>
<td valign="top" height="50px" align="center">
<span class="footer">Contact Sue Simmons on: tel:
<strong>+44 (0)1727 864806
<a href="mailto:info@aoec.com">info@aoec.com</a>
<a href="http://www.aoec.com">www.aoec.com</a>
</strong>
</span>
<br>
<a href="https://twitter.com/theaoec/">
<img class="style2" border="0" src="http://www.aoec.com/Images/Icons/twitter.png" alt="Twitter">
</a>
<a href="http://www.linkedin.com/groups/AoEC-2429085">
<img class="style2" border="0" src="http://www.aoec.com/Images/Icons/linkedIn.png" alt="LinkedIn">
</a>
</td>
</tr>
</tbody>
</table>
我想找出两个图像标签之间的标签。
我使用nextSiblingElement()尝试了它,但它不起作用,因为<a>
标记导致了一个问题
在上面的代码中,我放置了一个如下所述的代码
Document cc = Jsoup.parse(html);
Elements imageElements = cc.select("img");
现在我在提取它时得到第一个标记。所以我想检查下一张,这两张图是用td,p,div分开的
# 1 楼答案
请尝试JSoup,强烈推荐
# 2 楼答案
图像标签之间没有任何内容。它们在“a”标签内
请在你的问题中添加你想要的文本