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)
| 67 | // doc, err := goquery.NewDocumentFromReaderWithOptions(r, |
| 68 | // html.ParseOptionEnableScripting(false)) |
| 69 | func 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 |