title: Html parser ignores img tag (Golang)
body: <p>My task is to find images urls inside an html</p>
  
  <p><strong>The problem</strong></p>
  
  <p>Html parser <code>golang.org/x/net/html</code> as well as 
  <code>github.com/PuerkitoBio/goquery</code> igonores the biggest image on the page <a href="http://www.ozon.ru/context/detail/id/34498204/" rel="nofollow">http://www.ozon.ru/context/detail/id/34498204/</a></p>
  
  <p><strong>The question</strong></p>
  
  <ul>
  <li>What is wrong in my code</li>
  <li>Why required <code>img</code> tag with <code>src=""</code> is ignored?</li>
  <li>Is there are way to get all images from html with go?</li>
  </ul>
  
  <p><strong>Notes:</strong></p>
  
  <ul>
  <li><p>When i used <a href="https://github.com/tid-kijyun/Kanna" rel="nofollow">parser written in Swift</a> this image has been found on the page <code>//static2.ozone.ru/multimedia/spare_covers/1013531536.jpg</code></p></li>
  <li><p>This image tag has been found when i use regex search.</p></li>
  <li><p>This image tag has been found when i use third party service <a href="http://saveallimages.com/" rel="nofollow">saveallimages.com</a></p></li>
  <li><p>I tried to use gokogiri but has no success to compile it on my mac. <code>Go get</code> is successful, but <code>Go build</code> stuck forever. </p></li>
  </ul>
  
  <p><strong>Parsed html page source</strong></p>
  
  <p><a href="https://drive.google.com/open?id=0Bw-eomJ7SS0EVElORE1Sd3JDaTA" rel="nofollow">This is the html</a> which is result of <code>resp, _ := http.Get(url)</code></p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>package main
  
  import (
    "golang.org/x/net/html"
    "log"
    "net/http"
  )
  
  
  func main() {
  
    url := "http://www.ozon.ru/context/detail/id/34498204/"
  
    if resp, err := http.Get(url); err == nil {
      defer resp.Body.Close()
  
      log.Println("Load page complete")
  
      if resp != nil {
        log.Println("Page response is NOT nil")
  
        if document, err := html.Parse(resp.Body); err == nil {
  
          var parser func(*html.Node)
          parser = func(n *html.Node) {
            if n.Type == html.ElementNode &amp;&amp; n.Data == "img" {
  
              var imgSrcUrl, imgDataOriginal string
  
              for _, element := range n.Attr {
                if element.Key == "src" {
                  imgSrcUrl = element.Val
                }
                if element.Key == "data-original" {
                  imgDataOriginal = element.Val
                }
              }
  
              log.Println(imgSrcUrl, imgDataOriginal)
            }
  
            for c := n.FirstChild; c != nil; c = c.NextSibling {
              parser(c)
            }
  
          }
          parser(document)
        } else {
          log.Panicln("Parse html error", err)
        }
  
      } else {
        log.Println("Page response IS nil")
      }
    }
  
  }
  </code></pre>