===^^===
《榴芒客服系统》是我们工作室开发的在线客服系统,欢迎下载试用:
《榴芒客服系统》https://blog.csdn.net/look4liming/article/details/164755808
import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class JsoupParserTest { public static void main(String[] args) { StringBuilder buf = new StringBuilder(); buf.append("<html>"); buf.append("<head>"); buf.append("<title>这是标题。</title>"); buf.append("</head>"); buf.append("<body>"); buf.append("<p>这是内容。</p>"); buf.append("</body>"); buf.append("</html>"); String html = buf.toString(); Document doc = Jsoup.parse(html); System.out.println(doc); } }输出如下:
<html>
<head>
<title>这是标题。</title>
</head>
<body>
<p>这是内容。</p>
</body>
</html>
要运行此程序,需要以下jar包:
jsoup-1.11.3.jar
===^^===
《榴芒客服系统》是我们工作室开发的在线客服系统,欢迎下载试用:
《榴芒客服系统》https://blog.csdn.net/look4liming/article/details/164755808