Package webutil is for working with the web at a higher level of abstraction than net/http and such.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
doc.go
error.go
html.go
http.go

README.md

webutil

webutil provides Go functions that operate at a level better matching the level that I'm working at when I'm using JSON API's and scraping the web.

Features

  • GET a []byte. 404, etc. are an error.
  • Same, but return an io.ReadCloser.
  • Same, but parse with net/html and return the html.Node. Useful for using Cascadia to extract parts.
  • Get text from an html.Node.
  • Walk an html.Node.

Usage

go get sethwklein.net/go/webutil

import "sethwklein.net/go/webutil"

http://godoc.org/sethwklein.net/go/webutil

Rationale

I know better than to publish this package. Someone has said (I don't have a link handy :( ) that packages with util in the name are almost always a bad idea. And it makes no sense to use a package that pulls in an HTML parser when all you need is a []byte. But I can't seem to stop using it, so I'm publishing it even if it should be a bad idea.