登录 注册

jsoup

去点 Star
开发者工具
11,415
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Java
语言
创建时间
最近更新

项目能做什么

经典的 Java HTML 解析库,专为 HTML 数据抓取、解析、清洗及防范 XSS 设计。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# jsoup: Java HTML Parser

**jsoup** is a Java library that makes it easy to work with real-world HTML and XML. It offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM API methods, CSS, and xpath selectors.

**jsoup** implements the [WHATWG HTML5](https://html.spec.whatwg.org/multipage/syntax.html) specification, and parses HTML to the same DOM as modern browsers.

- [Scrape and parse HTML](https://jsoup.org/cookbook/input/parse-document-from-string) from a URL, file, or string.
- [Find and extract data](https://jsoup.org/cookbook/extracting-data/selector-syntax) using DOM traversal or CSS selectors.
- [Manipulate HTML elements](https://jsoup.org/cookbook/modifying-data/set-html), attributes, and text.
- [Clean user-submitted content](https://jsoup.org/cookbook/cleaning-html/safelist-sanitizer) against a safelist to prevent XSS attacks.
- [Output tidy HTML](https://jsoup.org/apidocs/org/jsoup/nodes/Element.html#html()).

jsoup is designed to deal with all varieties of HTML found in the wild; from pristine and validating, to invalid tag-soup; jsoup will create a sensible parse tree.

See [**jsoup.org**](https://jsoup.org/) for downloads and the full [API documentation](https://jsoup.org/apidocs/).

[![Build Status](https://github.com/jhy/jsoup/workflows/Build/badge.svg)](https://github.com/jhy/jsoup/actions?query=workflow%3ABuild)

## Example
Fetch the [Wikipedia homepage](https://en.wikipedia.org/wiki/Main_Page), parse it to a [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Introduction), and select the headlines from the *In the news* section into a list of [Elements](https://jsoup.org/apidocs/org/jsoup/select/Elements.html) ([online sample](https://try.jsoup.org/~LGB7rk_atM2roavV0d-czMt3J_g), [full source](https://github.com/jhy/jsoup/blob/master/src/main/java/org/jsoup/examples/Wikipedia.java)):

```java
Document doc = Jsoup.connect("https://en.wikipedia.org/").get();
log(doc.title());
Elements newsHeadlines = doc.select("#mp-itn b a");
for (Element headline : newsHeadlines) {
    log("%s\n\t%s",
        headline.attr("title"), headline.absUrl("href"));
}
```

## Open Source
jsoup is an open source project distributed under the liberal [MIT license](https://jsoup.org/license). The source code is available on [GitHub](https://github.com/jhy/jsoup).

## Getting Started
1. [**Download**](https://jsoup.org/download) the [latest](https://github.com/jhy/jsoup/releases/tag/jsoup-1.23.1) jsoup jar (or add it to your Maven/Gradle build)
2. Read the [cookbook introduction](https://jsoup.org/cookbook/introduction/parsing-a-document).
3. Enjoy!

Maven:

```xml
<dependency>
  <!-- jsoup HTML parser library @ https://jsoup.org/ -->
  <groupId>org.jsoup</groupId>
  <artifactId>jsoup</artifactId>
  <version>1.23.2</version>
</dependency>
```

Gradle:

```groovy
// jsoup HTML parser library @ https://jsoup.org/
implementation 'org.jsoup:jsoup:1.23.1'
```

### Android Support
When used in 
阅读完整原文

商业机会分析 规则生成(AI 未配置)

综合评分 45.3 分。该项目在“个人可实施性”维度得 37 分,“付费可能性”维度得 32.0 分,差异化空间 70.0 分(评分依据见评分卡)。

面向细分需求的二次开发产品

产品构想基于 jsoup 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
ssssssss-team/spider-flow 中文介绍暂未生成
新一代爬虫平台,以图形化方式定义爬虫流程,不写代码即可完成爬虫。
11,364 Java
codeestX/GeekNews 中文介绍暂未生成
:books:A pure reading App based on Material Design + MVP + R
3,490 Java
wenbochang888/house 中文介绍暂未生成
有完整版的PDF下载。
3,226 Java
xtuhcy/gecco 中文介绍暂未生成
Easy to use lightweight web crawler(易用的轻量化网络爬虫)
2,511 Java
670848654/SakuraAnime 中文介绍暂未生成
使用jsoup爬取樱花动漫(Yhdm)、嘶哩嘶哩(SiliSili)部分内容编写的第三方Android客户端。
2,034 Java
skrapeit/skrape.it 中文介绍暂未生成
A Kotlin-based testing/scraping/parsing library providing th
873 Kotlin
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 ,最近推送 ,发布过 25 个 Release
社区活跃Star 11,415 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/jhy/jsoup.git
cd jsoup
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。