Class: NeweggScraperChsbr::Scraper

Inherits:
Object
  • Object
show all
Defined in:
lib/newegg_scraper_chsbr/scraper.rb

Constant Summary collapse

URL =
"https://www.newegg.com/p/pl?d=cpu"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url = URL) ⇒ Scraper

Returns a new instance of Scraper.



6
7
8
# File 'lib/newegg_scraper_chsbr/scraper.rb', line 6

def initialize(url = URL)
    @xml_obj = Nokogiri::HTML(URI.open(url)) 
end

Instance Attribute Details

#xml_objObject (readonly)

Returns the value of attribute xml_obj.



3
4
5
# File 'lib/newegg_scraper_chsbr/scraper.rb', line 3

def xml_obj
  @xml_obj
end