Documentation ¶
Overview ¶
Package web interacts with web pages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUserAgent ¶
func SetUserAgent(ua string)
SetUserAgent sets a value for the "User-Agent" header to be sent in all future HTTP requests.
Types ¶
type Page ¶
Page represents a parsed HTML page.
func (*Page) Query ¶
func (p *Page) Query(query string) QueryResult
Query calls QueryNode using p.Root.
func (*Page) QueryAll ¶ added in v0.1.3
func (p *Page) QueryAll(query string) QueryAllResult
QueryAll returns all nodes matched by the supplied CSS selector. Unlike Query/QueryNode, an error is not returned if no nodes are matched.
type QueryAllResult ¶ added in v0.1.3
QueryAllResult contains the result of a call to QueryAll.
type QueryResult ¶
QueryResult contains the result of a call to Query or QueryNode.
func QueryNode ¶ added in v0.1.3
func QueryNode(root *html.Node, query string) QueryResult
QueryNode returns the first node matched by the supplied CSS selector. The returned result has a non-nil Err field if no node was matched.
Click to show internal directories.
Click to hide internal directories.