goquery
14,991
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
Go
语言
创建时间
最近更新
项目能做什么
Go 语言版类 jQuery 库,提供类似 jQuery 的语法来解析和操作 HTML DOM。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# goquery - a little like that j-thing, only in Go
[](https://github.com/PuerkitoBio/goquery/actions)
[](https://pkg.go.dev/github.com/PuerkitoBio/goquery)
[](https://sourcegraph.com/github.com/PuerkitoBio/goquery?badge)
goquery brings a syntax and a set of features similar to [jQuery][] to the [Go language][go]. It is based on Go's [net/html package][html] and the CSS Selector library [cascadia][]. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off.
Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the [wiki][] for various options to do this.
Syntax-wise, it is as close as possible to jQuery, with the same function names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, I felt that writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's `fmt` package), even though some of its methods are less than intuitive (looking at you, [index()][index]...).
## Supporters
<a href="https://serpapi.com/?utm_source=goquery">
<img src="misc/assets/serpapi.png" alt="SerpApi" width="600px">
</a>
[SerpApi](https://serpapi.com/?utm_source=goquery) is the world's leading provider of search data, pioneering APIs that turn search engine results into structured, developer-ready information.
## Table of Contents
* [Installation](#installation)
* [Changelog](#changelog)
* [API](#api)
* [Examples](#examples)
* [Related Projects](#related-projects)
* [Support](#support)
* [License](#license)
## Installation
Required Go version:
* Starting with version `v1.12.0` of goquery, Go 1.25+ is required due to its dependencies.
* Starting with version `v1.11.0` of goquery, Go 1.24+ is required due to its dependencies.
* Starting with version `v1.10.0` of goquery, Go 1.23+ is required due to the use of function-based iterators.
* For `v1.9.0` of goquery, Go 1.18+ is required due to the use of generics.
* For previous goquery versions, a Go version of 1.1+ was required because of the `net/html` dependency.
Ongoing goquery development is tested on the latest 2 versions of Go.
$ go get github.com/PuerkitoBio/goquery
(optional) To run unit tests:
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
$ go test
(optional) To run benchmarks (warning: it runs for a few minutes):
$ cd $GOPATH/src/github.com/PuerkitoBio/goquery
$ go test -bench=".*"
## Changelog
**Note that goquery's API is now stable, and will not break.**
* *
阅读完整原文
商业机会分析 AI 生成
云端网页结构化抽取 API / Headless 代理服务
| 产品构想 | 基于 goquery 作为核心解析引擎,构建支持动态 JS 渲染、代理轮换、防封禁与自动利用 goquery 规则提取结构化 JSON 的 SaaS 平台(参考 SerpApi / ScrapingBee 模式)。 |
| 核心功能 | 代理 IP 自动轮换、无头浏览器动态页面渲染、内置/自定义 goquery CSS 提取规则配置、JSON 结果直出、Webhook 异步回调。 |
| 目标用户 | 需要从网页批量提取结构化数据但不想维护代理池与动态浏览器环境的中小型开发者与企业团队。 |
| 难度/周期 | 高 · 2 - 3 个月 · 成本:中等(需要采购代理 IP 池、动态渲染服务器资源)。 |
| 收费模式 | 按 API 调用量订阅制(API Request 配额计费)。 |
| 竞争风险 | 带宽与代理成本高,防爬虫对抗策略更新频繁,运维开销较大。 |
| 依据 | 已验证事实 |
可视化网页提取规则生成器与 Schema 转换工具 (Chrome 插件 + 云端同步)
| 产品构想 | 提供网页可视化点击生成对应 goquery CSS 选择器与 Go 代码片段的工具,支持输出结构化 Go Struct 与清洗代码,并提供规则云端托管与版本同步。 |
| 核心功能 | 可视化点选生成最优 CSS 选择器、一键导出 goquery 代码与 Go 结构体映射、多版本页面变更监控、选择器失效告警。 |
| 目标用户 | 写 Go 爬虫的工程师、需要快速配置特定页面抓取规则的数据团队。 |
| 难度/周期 | 中等 · 1 - 2 个月 · 成本:低(轻量前后端架构,少量数据库与存储)。 |
| 收费模式 | Freemium 模式,基础生成免费,团队协作共享规则与页面结构监控告警收费。 |
| 竞争风险 | 目标用户群体(程序员)往往倾向于手动写代码或使用已有 Chrome 调试工具,工具付费转化率低。 |
| 依据 | AI推测 |
开源项目商业赞助位与垂直爬虫生态广告集成
| 产品构想 | 利用 goquery 极高的 Star 数 (14.9k+) 和在 Go 爬虫领域的入口地位,为数据抓取生态服务商(如代理服务商、CAPTCHA 破解平台、数据提供商)提供 README、Wiki 与示例代码赞助展示与技术推荐。 |
| 核心功能 | README 首页黄金广告位展示、官方推荐集成指南(Integration Showcase)、定期技术文章案例推荐。 |
| 目标用户 | 寻找开发者的代理服务商、爬虫基础设施厂商(如已赞助的 SerpApi、Bright Data 等)。 |
| 难度/周期 | 低 · 2 - 4 周 · 成本:极低(仅商务沟通与文档维护成本)。 |
| 收费模式 | 按月/按季收取固定赞助席位广告费。 |
| 竞争风险 | 依赖项目仓库本身的流量和品牌声誉,商业天花板受限。 |
| 依据 | 已验证事实 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| 003random/getJS | 中文介绍暂未生成 A tool to fastly get all javascript sources/files |
902 | Go |
| andrewstuart/goq | 中文介绍暂未生成 A declarative struct-tag-based HTML unmarshaling or scraping |
270 | Go |
| Dentrax/GMDB | 中文介绍暂未生成 GMDB is the ultra-simple, cross-platform Movie Library with |
242 | Go |
| crufter/goquery | 中文介绍暂未生成 Jquery style selector engine for HTML documents, in Go. |
162 | Go |
| foolin/pagser | 中文介绍暂未生成 Pagser is a simple, extensible, configurable parse and deser |
112 | Go |
| AbGuthrie/goquery | 中文介绍暂未生成 Provide a shell like interface by utilizing osquery's distri |
82 | Go |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 ,最近推送 ,发布过 26 个 Release |
| 社区活跃 | Star 14,991 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/PuerkitoBio/goquery.git cd goquery # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。