github.com/PuerkiTobio/goquery (go): Package goquery implements features similar to jQuery, including the chainable syntax, to manipulate and query an HTML document.  It brings a syntax and a set of features similar to jQuery to the Go language. It is based on Go's net/html package and the CSS Selector library cascadia. Since the net/html parser returns nodes, and not a full-featured DOM tree, jQuery's stateful manipulation functions (like height(), css(), detach()) have been left off.  Also, because the net/html parser requires UTF-8 encoding, so does goquery: it is the caller's responsibility to ensure that the source document provides UTF-8 encoded HTML. See the repository's wiki for various options on how to do this.  Syntax-wise, it is as close as possible to jQuery, with the same method names when possible, and that warm and fuzzy chainable interface. jQuery being the ultra-popular library that it is, writing a similar HTML-manipulating library was better to follow its API than to start anew (in the same spirit as Go's fmt package), even though some of its methods are less than intuitive (looking at you, index()...).  It is hosted on GitHub, along with additional documentation in the README.md file: https://github.com/puerkitobio/goquery  Please note that because of the net/html dependency, goquery requires Go1.1+.  The various methods are split into files based on the category of behavior. The three dots (...) indicate that various "overloads" are available.  * array.go : array-like positional manipulation of the selection.  * expand.go : methods that expand or augment the selection's set.  * filter.go : filtering methods, that reduce the selection's set.  * iteration.go : methods to loop over the selection's nodes.  * manipulation.go : methods for modifying the document  * property.go : methods that inspect and get the node's properties values.  * query.go : methods that query, or reflect, a node's identity.  * traversal.go : methods to traverse the HTML document tree.  * type.go : definition of the types exposed by goquery.  * utilities.go : definition of helper functions (and not methods on a *Selection) that are not part of jQuery, but are useful to goquery.  This example scrapes the reviews shown on the home page of metalsucks.net.
Keywords: goquery|html-parsing|jquery|selector-strings