Versions in this module Expand all Collapse all v0 v0.0.1 Sep 21, 2023 Changes in this version + const CSSSelector + const HTMLRegexp + const JSONRegexp + const RegularExpr + const TextRegexp + const XMLRegexp + const XPathExpr + var ErrExprType = errors.New("ExprType not compatible with Element") + var ErrNotMatch = errors.New("Content-Type does not match") + func Set(parsers *Parsers, expr string, parserFunc func(colibri.Response) (T, error)) error + type Element interface + Find func(expr, exprType string) (Element, error) + FindAll func(expr, exprType string) ([]Element, error) + Value func() any + type HTMLElement struct + func ParseHTML(resp colibri.Response) (*HTMLElement, error) + func (html *HTMLElement) CSSFind(expr string) (Element, error) + func (html *HTMLElement) CSSFindAll(expr string) ([]Element, error) + func (html *HTMLElement) Find(expr, exprType string) (Element, error) + func (html *HTMLElement) FindAll(expr, exprType string) ([]Element, error) + func (html *HTMLElement) Value() any + func (html *HTMLElement) XPathFind(expr string) (Element, error) + func (html *HTMLElement) XPathFindAll(expr string) ([]Element, error) + type JSONElement struct + func ParseJSON(resp colibri.Response) (*JSONElement, error) + func (json *JSONElement) Find(expr, exprType string) (Element, error) + func (json *JSONElement) FindAll(expr, exprType string) ([]Element, error) + func (json *JSONElement) Value() any + type ParserFunc func(colibri.Response) (Element, error) + type Parsers struct + func New() (*Parsers, error) + func (parsers *Parsers) Clear() + func (parsers *Parsers) Match(contentType string) bool + func (parsers *Parsers) Parse(rules *colibri.Rules, resp colibri.Response) (map[string]any, error) + type TextElement struct + func ParseText(resp colibri.Response) (*TextElement, error) + func (text *TextElement) Find(expr, exprType string) (Element, error) + func (text *TextElement) FindAll(expr, exprType string) ([]Element, error) + func (text *TextElement) Value() any + type XMLElement struct + func ParseXML(resp colibri.Response) (*XMLElement, error) + func (xml *XMLElement) Find(expr, exprType string) (Element, error) + func (xml *XMLElement) FindAll(expr, exprType string) ([]Element, error) + func (xml *XMLElement) Value() any