版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_20120669/article/details/82225748
public class ContentTest { public static void main(String[] args) { String html="<p style=\"text-align: center;\"> </p> \n" + "<p style=\"text-align: center;\"><span style=\"color: rgb(255, 255, 255);\">。1111111</span></p>"; Document document= Jsoup.parse(html); System.out.println(document); document.select("html").text().length(); } }