FEATURED · 精选文章

Jsoup解析完整的HTML

发布时间 / 2026/9/20 1:20:00
来源 / 创域科博编辑部
栏目 / 资讯中心
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
RELATED — 相关阅读

相关资讯

LATEST — 最新资讯

最新发布

TODAY — 本日精选

新闻

WEEKLY — 本周精选

新闻

MONTHLY — 本月精选

新闻