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); + } +}