def get_document(url)
      URI === url ? Nokogiri::HTML::Document.parse(open(url), url.to_s, 'UTF-8') : url
    rescue OpenURI::HTTPError
      $stderr.puts "ERROR opening #{url}"
      Nokogiri('')
    end
def get_document(url)
      URI === url ? Nokogiri::HTML::Document.parse(open(url), url.to_s, 'UTF-8') : url
    rescue OpenURI::HTTPError
      $stderr.puts "ERROR opening #{url}"
      Nokogiri('')
    end
open web pages with UTF-8 encoding