Documentation ¶
Overview ¶
Package gostruct provides a simple API to populate structs from webpages using CSS selectors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fetch ¶
Fetch fetches a document from an URL and populates the given target, which must be a pointer on a struct. See Populate for the details.
func Populate ¶
Populate fills a struct using the given goquery document. The target must be a pointer on a struct. Types are parsed as follow:
- uint, int, float, duration, and string values are parsed from the first element which match the selector
- bool values are true if the text from the selection is not empty
- slice values are parsed with one slice element per element in the selection.
If a selector contains a slash, the part after it is assumed to be an attribute name. The attribute's value will then be used instead of the element's content.
func PopulateFromResponse ¶
PopulateFromResponse fills a struct using the given HTTP response. See Populate for the details.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.