ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Jsoup解析完整的HTML

Jsoup解析完整的HTML ^^《榴芒客服系统》是我们工作室开发的在线客服系统欢迎下载试用《榴芒客服系统》https://blog.csdn.net/look4liming/article/details/164755808import 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); } }输出如下htmlheadtitle这是标题。/title/headbodyp这是内容。/p/body/html要运行此程序需要以下jar包jsoup-1.11.3.jar^^《榴芒客服系统》是我们工作室开发的在线客服系统欢迎下载试用《榴芒客服系统》https://blog.csdn.net/look4liming/article/details/164755808
返回列表