Class: PictureFrom::Crawlers::BaseCrawler::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/picture_from/crawlers/base_crawler.rb

Instance Method Summary collapse

Instance Method Details

#open_url(url) ⇒ Object



9
10
11
12
13
14
# File 'lib/picture_from/crawlers/base_crawler.rb', line 9

def open_url(url)
  uri = URI.escape(url)
  Nokogiri::HTML open(uri)
rescue OpenURI::HTTPError
  nil
end