Sha256: fb4387e0dc41e9c9ea216e4ce67b79d3d0e1d63354f7cc25884b18602c8e82f7
Contents?: true
Size: 411 Bytes
Versions: 7
Compression:
Stored size: 411 Bytes
Contents
module Notu module HtmlDocument def self.get(url, options = {}) parse(HttpDownload.get(url, options)) end def self.parse(data) data = data.gsub(/ /i, ' ').gsub(/\s+/, ' ') document = Nokogiri::HTML.parse(data, nil, 'UTF-8') raise ParseError.new('Invalid HTML document') if (document/'head').empty? document end private_class_method :parse end end
Version data entries
7 entries across 7 versions & 1 rubygems