Skip to content

Package webutil is for working with the web at a higher level of abstraction than net/http and such.

License

Notifications You must be signed in to change notification settings

sethwklein/gowebutil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Package webutil is for working with the web at a higher level of abstraction than net/http and such.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages