Method: IndoorJungle::Scraper.scrape_plant

Defined in:
lib/indoor_jungle/scraper.rb

.scrape_plant(plant_url) ⇒ Object

here lies my mess



19
20
21
22
23
24
25
26
27
# File 'lib/indoor_jungle/scraper.rb', line 19

def self.scrape_plant(plant_url)
  page = Nokogiri::HTML(URI.open(plant_url))
  plant = {}
  element = page.css('div.product-layout-')
    plant[:sunlight] = element.css('p.condition-text.mb-0').first.text,
    plant[:water] = element.css('div.image-card p')[1].text,
    plant[:temperature] = element.css('div.image-card p')[2].text.delete("\u00B0F")
    plant #currently this whole hash is being applied to sunlight
end