MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / NewDocumentFromReaderWithOptions

Function NewDocumentFromReaderWithOptions

type.go:69–75  ·  view source on GitHub ↗

NewDocumentFromReaderWithOptions is like NewDocumentFromReader, with the parse options of the html package. For example: doc, err := goquery.NewDocumentFromReaderWithOptions(r, html.ParseOptionEnableScripting(false))

(r io.Reader, opts ...html.ParseOption)

Source from the content-addressed store, hash-verified

67// doc, err := goquery.NewDocumentFromReaderWithOptions(r,
68// html.ParseOptionEnableScripting(false))
69func NewDocumentFromReaderWithOptions(r io.Reader, opts ...html.ParseOption) (*Document, error) {
70 root, e := html.ParseWithOptions(r, opts...)
71 if e != nil {
72 return nil, e
73 }
74 return newDocument(root, nil, opts...), nil
75}
76
77// NewDocumentFromResponse is another Document constructor that takes an http response as argument.
78// It loads the specified response's document, parses it, and stores the root Document

Calls 1

newDocumentFunction · 0.85