module Irasutoya::Modules::HasDocumentFetcher::Methods
Public Instance Methods
fetch_page_and_parse(url)
click to toggle source
# File lib/irasutoya/modules/has_document_fetcher.rb, line 13 def fetch_page_and_parse(url) charset = nil html = URI.parse(url).open do |f| charset = f.charset f.read end Nokogiri::HTML.parse(html, nil, charset) end