Documentation ¶
Overview ¶
2017/12/29 21:15:58 Fri
2017/12/30 17:11:13 Sat
2017/12/29 23:05:54 Fri
Index ¶
- Constants
- Variables
- func AddTagNode(tag string, node []TagNode) map[string][]TagNode
- func HasSuffix(str string, exts []string) bool
- func IsImageUrl(s string) bool
- func IsJsUrl(s string) bool
- type DefaultHandler
- type Document
- type DocumentPreview
- type HtmlParser
- type Options
- type Scraper
- type Selection
- type TagHandler
- type TagNode
Constants ¶
View Source
const ( ValImage = iota ValScript )
Variables ¶
View Source
var (
EscapedFragment string = "_escaped_fragment_="
)
Functions ¶
func IsImageUrl ¶
Types ¶
type DefaultHandler ¶
type DefaultHandler struct { }
func (*DefaultHandler) TagsFilter ¶
func (h *DefaultHandler) TagsFilter(tag string) ([]TagNode, bool)
type Document ¶
type Document struct { *goquery.Document Body *bytes.Buffer Preview DocumentPreview }
func ScrapeRedirect ¶
func Scrape(uri, body string, maxRedirect int, handler TagHandler) (*Document, error) {
type DocumentPreview ¶
type HtmlParser ¶
type HtmlParser struct { Url *url.URL EscapedFragmentUrl *url.URL Body []byte MaxRedirect int Preview DocumentPreview TagsMap map[string][]TagNode // contains filtered or unexported fields }
func NewScrape ¶
func NewScrape(opts *Options) (*HtmlParser, error)
func (*HtmlParser) AddTagNode ¶
func (scraper *HtmlParser) AddTagNode(tag string, node []TagNode)
func (*HtmlParser) Scrape ¶
func (scraper *HtmlParser) Scrape() (*Document, error)
type Options ¶
type Options struct { Url string MaxRedirect int Body string Handler TagHandler HtmlFile string }
type Scraper ¶
type TagHandler ¶
Click to show internal directories.
Click to hide internal directories.