Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter receives an io.Reader from which to extract the HTML nodes.
It returns an error if there is any problem while extracting the tokens to create the HTML nodes.
You can pass none, one or more FilterFn functions to apply. The order of the filters affects the result.
It finally returns an []*html.Node.
func Images ¶
Images receives an io.Reader from which to extract all the image sources. It returns an error if there is any problem while extrating the tokens to create the HTML nodes from which extract the images sources. If nothing goes wrong it returns a []string with all the image sources found.
Types ¶
type FilterFn ¶
FilterFn defines a filter to filter HTML nodes. If the filter returns true, the HTML node is added to the result of the Filter function. If the filter returns false the HTML node is excluded.
func FilterByAttr ¶
FilterByAttr receives an HTML attribute and returns a FilterFn that can be used as a filter on the Filter function.
func FilterByClass ¶
FilterByClass receives a CSS class and returns a FilterFn that can be used as a filter on the Filter function.
func FilterByID ¶
FilterByID receives an ID and returns a FilterFn that can be used as a filter on the Filter function.
func FilterByTag ¶
FilterByTag receives an HTML tag without "<" nor ">" and returns a FilterFn that can be used as a filter on the Filter function.