Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用过这段代码:
String innerHtml = Jsoup.parse(htmlCode,"ISO-8859-1").select("body").html();
但它只删除<html>标签
<html>
内的任何HTML标签body仍然会出现
HTML
body
使用.text()而不是.html()获取元素及其所有子元素的组合文本。
.text()
.html()
尝试使用.text():
Jsoup.parse(htmlCode,"ISO-8859-1").select("body").text();
而不是.html().