Scrape parent element for iframe

Current behavior: if you have an `iframe` scraper rule, `scrapContent`
tries to return the inner HTML of the `iframe`, which turns up blank.

New behavior: like `img` elements, if an `iframe` is matched by a scraper rule,
the parent element's inner HTML (i.e. the `iframe` is returned).
This commit is contained in:
aniran 2018-04-26 16:51:07 -04:00 committed by Frédéric Guillot
parent 920dda79b7
commit 322b265d7a
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ func scrapContent(page io.Reader, rules string) (string, error) {
var content string
// For some inline elements, we get the parent.
if s.Is("img") {
if s.Is("img") || s.Is("iframe") {
content, _ = s.Parent().Html()
} else {
content, _ = s.Html()