From a064e422eb1ce4a1bdf844d66c8418d34c6ea91c Mon Sep 17 00:00:00 2001 From: Wonder Date: Thu, 16 Oct 2025 21:01:15 +0800 Subject: [PATCH] =?UTF-8?q?Update:=20=E5=AF=BC=E5=85=A5=20Jsoup=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ pom.xml | 23 +++++++++++++++++++ .../java/cn/hezhaohui/fund/Application.java | 18 +++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/cn/hezhaohui/fund/Application.java diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e647fd1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.idea/ +target \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..e6b6490 --- /dev/null +++ b/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + cn.hezhaohui + fund-crawler + 1.0-SNAPSHOT + + + 21 + + + + + + org.jsoup + jsoup + 1.17.2 + + + + diff --git a/src/main/java/cn/hezhaohui/fund/Application.java b/src/main/java/cn/hezhaohui/fund/Application.java new file mode 100644 index 0000000..7771c6e --- /dev/null +++ b/src/main/java/cn/hezhaohui/fund/Application.java @@ -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 = "My title" + + "Body content"; + + 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); + } +}