Registry / utility / ericchiang-css

ericchiang-css

JSON →
library1.4.0gogounverified

Implements CSS selector-based HTML node searching, compatible with golang.org/x/net/html and Selectors Level 4.

go get github.com/ericchiang/css
INSTALL
IMPORT
SIG · ERICCHIANG-CSS
E
ericchiang-css
utilitygov1.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

css
github.com/ericchiang/css

Parses an HTML document and selects elements matching a CSS selector.

package main import ( "fmt" "strings" "github.com/ericchiang/css" "golang.org/x/net/html" ) func main() { doc, _ := html.Parse(strings.NewReader("<html><body><p id='foo'>Hello</p></body></html>")) sel, _ := css.Parse("#foo") for _, node := range css.Select(doc, sel) { fmt.Println(node.Data) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.4.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ericchiang-css — go get ericchiang-css · libregistry