Java爬虫(一)--工程的构建

来源:互联网 发布:汉化软件安卓版下载 编辑:程序博客网 时间:2024/06/08 00:21

一、新建项目

通过 http://start.spring.io/ 构建简单的 Spring Boot 工程。
这里写图片描述

二、把工程导入 eclipse 后,在 pom.xml 中添加相关的 maven 依赖

  • 1、Jsoup 依赖
  • 2、由于需要用到 http 请求访问对应的页面,所以需要引入 httpclient 依赖。
<!-- Jsoup  --><dependency>    <groupId>org.jsoup</groupId>    <artifactId>jsoup</artifactId>    <version>1.10.3</version></dependency><!-- httpclient  --><dependency>    <groupId>org.apache.httpcomponents</groupId>    <artifactId>httpclient</artifactId>    <version>4.5.3</version></dependency>