Categorygithub.com/joeycumines/go-htmlutil
modulepackage
1.2.0
Repository: https://github.com/joeycumines/go-htmlutil.git
Documentation: pkg.go.dev

# README

htmlutil

coverage: 100%

Package htmlutil implements a wrapper for Golang's html5 tokeniser / parser implementation, making it much easier to find and extract information, aiming to be powerful and intuitive while remaining a minimal and logical extension.

See the godoc

As of v1.0.0 the API is stable and used in multiple (personal) projects. Unless I run into a compelling use case I am declaring this feature complete. It would be nice to add some examples though, maybe later.

Change Log

2019-08-20 v1.2.0 words methods

2019-02-14 v1.1.0 classes methods

2019-02-11 v1.0.0 initial release

# Functions

Parse first performs html.Parse, parsing through any errors, before applying a find to the resulting Node (wrapped like `Node{Data: node}`), returning the first matching Node, or an error, if no matches were found.

# Structs

Node is the data structure this package provides to allow utilisation of utility methods + extra metadata such as the last match (`Match` property) for filter / find / get calls, as well as the overall (relative) depth, allowing matching on things such as "all the table row elements that are direct children of a given tbody", a-la CSS selectors.