Registry / utility / yhat-scrape

yhat-scrape

JSON →
library0.0.0-20161128144610-24b7890b0945gogounverified

Package scrape provides a searching API on top of golang.org/x/net/html for HTML scraping.

go get github.com/yhat/scrape
INSTALL
IMPORT
SIG · YHAT-SCRAPE
Y
yhat-scrape
utilitygov0.0.0-20161128144610-24b7890b0945
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.

scrape
github.com/yhat/scrape

Find the first HTML node with a specific class attribute

package main import ( "fmt" "net/http" "github.com/yhat/scrape" "golang.org/x/net/html" ) func main() { resp, _ := http.Get("https://example.com") root, _ := html.Parse(resp.Body) matcher := func(n *html.Node) bool { return scrape.Attr(n, "class") == "content" } node, _ := scrape.Find(root, matcher) fmt.Println(scrape.Text(node)) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20161128144610-24b7890b0945latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
yhat-scrape — go get yhat-scrape · libregistry