Update: 导入 Jsoup 依赖

This commit is contained in:
2025-10-16 21:01:15 +08:00
parent 81658f0b3a
commit a064e422eb
3 changed files with 43 additions and 0 deletions
@@ -0,0 +1,18 @@
package cn.hezhaohui.fund;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class Application {
public static void main(String[] args) {
String htmlString = "<html><head><title>My title</title></head>"
+ "<body>Body content</body></html>";
Document doc = Jsoup.parse(htmlString);
String title = doc.title();
String body = doc.body().text();
System.out.printf("Title: %s%n", title);
System.out.printf("Body: %s", body);
}
}