def find_favicon_urls_in_html(html)
      doc = Nokogiri.parse html
      candidate_urls = doc.css(ICON_SELECTORS.join(",")).map {|e| e.attr('href') }.compact
      candidate_urls.sort_by! {|href|
        if href =~ /\.ico/
          0
        elsif href =~ /\.png/
          1
        else
          2
        end
      }
      uri = URI final_url
      candidate_urls.map! do |href|
        href = URI.encode(URI.decode(href.strip))
        if href =~ /\A\/\//
          href = "#{uri.scheme}:#{href}"
        elsif href !~ /\Ahttp/
          # Ignore invalid URLS - ex. {http://i50.tinypic.com/wbuzcn.png}
          href = URI.join(url_root, href).to_s rescue nil
        end
        href
      end.compact.uniq
    end
def find_favicon_urls_in_html(html)
      doc = Nokogiri.parse html
      candidate_urls = doc.css(ICON_SELECTORS.join(",")).map {|e| e.attr('href') }.compact
      candidate_urls.sort_by! {|href|
        if href =~ /\.ico/
          0
        elsif href =~ /\.png/
          1
        else
          2
        end
      }
      uri = URI final_url
      candidate_urls.map! do |href|
        href = URI.encode(URI.decode(href.strip))
        if href =~ /\A\/\//
          href = "#{uri.scheme}:#{href}"
        elsif href !~ /\Ahttp/
          # Ignore invalid URLS - ex. {http://i50.tinypic.com/wbuzcn.png}
          href = URI.join(url_root, href).to_s rescue nil
        end
        href
      end.compact.uniq
    end
Tries to find favicon urls from the html content of query_url