Compare commits
2
Commits
81658f0b3a
...
644af33c20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
644af33c20 | ||
|
|
a064e422eb |
@@ -0,0 +1,2 @@
|
||||
*.idea/
|
||||
target
|
||||
@@ -0,0 +1,46 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>cn.hezhaohui</groupId>
|
||||
<artifactId>fund-crawler</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<java.version>21</java.version>
|
||||
</properties>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.17.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-http -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>5.8.31</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,9 @@
|
||||
package cn.hezhaohui.fund;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.hezhaohui.fund.util;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class WebUtil {
|
||||
public static String getContentByUrl(String url) {
|
||||
String string = HttpUtil.get(url);
|
||||
return string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.hezhaohui.fund.util;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class WebUtilTest {
|
||||
|
||||
@Test
|
||||
void getContentByUrl() {
|
||||
String content = WebUtil.getContentByUrl("https://fund.eastmoney.com/001068.html");
|
||||
System.out.println(content);
|
||||
Assert.notNull(content);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user