Sha256: 054cdc5f22190f0b400bf11aac1a937157b8eafb049a5e0464683c9a709f6796
Contents?: true
Size: 437 Bytes
Versions: 4
Compression:
Stored size: 437 Bytes
Contents
class FortuneTeller::HoroscopeScraping def self.scrape_nypost_horoscope doc=Nokogiri::HTML(open("http://nypost.com/horoscopes/")) doc.search("div#primary div.site-content>div.row article.box").each do |h| hs=FortuneTeller::Horoscope.new hs.name= h.search("header.entry-header>h3 a").text.strip hs.date = h.search("div.entry-meta p").text.strip hs.content=h.search("div.entry-content p").text.strip end end end
Version data entries
4 entries across 4 versions & 1 rubygems