67,513
社区成员
发帖
与我相关
我的任务
分享
我想在java内转换成json,怎么转啊。我看了下,你提供的这个方法,有些不懂。 String html = "<html><head><title>First parse</title></head>" + "<body><p>Parsed HTML into a doc.</p></body></html>"; Document doc = Jsoup.parse(html); 它提供的这个是在页面转换的吗?
String html = "<html><head><title>First parse</title></head>"
+ "<body><p>Parsed HTML into a doc.</p></body></html>";
Document doc=Jsoup.parse(html);
Elements elements=doc.getElementsByTag("p");
for (Element ele: elements) {
System.out.println(ele.text());
}
其他的自己看看方法。。。。