Class: RecipeGenerator::Scraper

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

Instance Method Summary collapse

Instance Method Details

#get_pageObject



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

def get_page
  doc = Nokogiri::HTML(open("http://www.bbcgoodfood.com/recipes/collection/vegetarian"))
end

#make_veggiesObject



13
14
15
16
17
# File 'lib/scraper.rb', line 13

def make_veggies
  veggies.each do |d| 
    RecipeGenerator::Recipe.new_vegetarian(d)
 end
end

#veggiesObject



9
10
11
# File 'lib/scraper.rb', line 9

def veggies
  self.get_page.css("div.view-content > div > span") 
end