这是我的代码。
<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分开。
最佳答案
尝试JSoup,强烈建议。