goquery

jQuery-like HTML parsing and manipulation library for Go. Goquery wraps Go's golang.org/x/net/html package with a jQuery-inspired API — use CSS selectors to find elements, extract text, attributes, and HTML from web pages. The standard Go web scraping and HTML parsing library, used with colly and other Go scrapers for structured data extraction from HTML documents.

Evaluated Mar 06, 2026 (0d ago) v1.9+
Homepage ↗ Repo ↗ Developer Tools go html scraping jquery css-selectors parsing dom data-extraction
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
82
/ 100
Is it safe for agents?
⚡ Reliability
87
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
84
Error Messages
80
Auth Simplicity
95
Rate Limits
95

🔒 Security

TLS Enforcement
85
Auth Strength
80
Scope Granularity
78
Dep. Hygiene
88
Secret Handling
82

HTML parsing library — no network exposure. Parsing untrusted HTML is safe (no eval). No credential handling. Community-maintained.

⚡ Reliability

Uptime/SLA
88
Version Stability
87
Breaking Changes
85
Error Recovery
88
AF Security Reliability

Best When

You're building Go scrapers or HTML processors and want jQuery CSS selector syntax for clean HTML data extraction.

Avoid When

The target page requires JavaScript execution — use chromedp or playwright-go for dynamic content.

Use Cases

  • Parse HTML responses from agent web crawlers to extract structured data using jQuery CSS selectors (Find('.price'), Attr('href'))
  • Build Go web scraping agents that extract product data, news articles, or document content from HTML pages
  • Process HTML documents in agent data pipelines — extract tables, lists, and structured content from HTML using CSS selectors
  • Validate and transform HTML content in agent document processing workflows using goquery's traversal API
  • Use goquery with colly for complete Go web scraping — colly handles HTTP crawling, goquery handles HTML data extraction

Not For

  • JavaScript-rendered pages — goquery only parses static HTML; use playwright-go or chromedp for JavaScript-rendered content
  • XML parsing — goquery targets HTML; use encoding/xml or etree for XML documents
  • Large-scale distributed scraping — goquery is a parsing library, not a crawling framework; use colly or scrapy for crawl orchestration

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

HTML parsing library — no authentication. HTTP auth handled by the HTTP client making the request.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

BSD 2-clause license. Community-maintained.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Find() returns empty Selection (not nil) when no elements match — check Selection.Length() > 0 before calling text extraction methods; empty Selection returns empty string, not an error
  • goquery does NOT handle JavaScript rendering — websites that load content via JS return empty result sets; use chromedp or playwright-go for JS-rendered pages
  • HTML attribute values may be relative URLs — call Selection.Attr('href') and check if the URL is relative, then resolve with base URL before using for HTTP requests
  • goquery modifies the parsed DOM in memory — Find().Text() on a deeply nested structure can be slow for large documents; consider XPath via htmlquery for complex selectors
  • Malformed HTML is silently corrected by Go's x/net/html parser — the parsed DOM may differ from the raw HTML source; goquery operates on the corrected DOM, not the original source
  • Selection.Each() and Map() iterate in document order — for parallel extraction of large numbers of items, collect elements first then process concurrently rather than using Each()

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for goquery.

$99

Scores are editorial opinions as of 2026-03-06.

5208
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered