Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用jsoup在img标记后检索信息_Html_Jsoup - Fatal编程技术网

Html 使用jsoup在img标记后检索信息

Html 使用jsoup在img标记后检索信息,html,jsoup,Html,Jsoup,我想使用jsoup检索html代码中的一些内容 <td valign="top" align="middle" class="text" align="center"> <img border="1" alt="board4" src="/graphics/associatn/12_ngo_soo_lin.jpg" width="80" height="101"><br> <b>吴斯仁</b><br>一丰有限

我想使用jsoup检索html代码中的一些内容

  <td valign="top" align="middle" class="text" align="center">
   <img border="1" alt="board4" src="/graphics/associatn/12_ngo_soo_lin.jpg" width="80" height="101"><br>
   <b>吴斯仁</b><br>一丰有限公司
  </td>
如何检索文本

<br><b>吴斯仁</b><br>一丰有限公司

吴斯仁
一丰有限公司
您需要a.)文本还是b.)包含html标记的文本

a、 )
String text=doc.select(“td”).text()


b、 )
String text=doc.select(“td>img~*”).toString()

b也检索
和标记。如何摆脱它们?如果您不需要这些标记,可以使用a.)或将b.)中的
toString()
替换为
text()
<br><b>吴斯仁</b><br>一丰有限公司