0
我正在使用jsoup 1.6.1,并在尝试从html中删除iframe标记时遇到问题。当iframe没有任何内容时(即< iframe pro = value />),remove()方法将删除t标签后的所有内容。这是我的示例代码。jsoup:删除iframe标记
String html ="<p> This is start.</p><iframe frameborder="0" marginheight="0" /><p> This is end</p>";
Document doc = Jsoup.parse(html,"UTF-8");<br>
doc.select("iframe").remove();<br>
System.out.println(doc.text());
它返回到我 -
This is start.
但我期待的结果 -
This is start. This is end
在此先感谢