Class: WikiScraper::Scraper

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

Instance Method Summary collapse

Instance Method Details

#get_page(search_term = "Cat") ⇒ Object



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

def get_page(search_term = "Cat")
  url = "https://en.wikipedia.org/wiki/#{search_term}"
  unparsed_page = HTTParty.get(url)
  Nokogiri::HTML(unparsed_page.body) #Returns parsed page
end