Sha256: d983850f0913c702a6ffdf88899a736f549a0bef64205ea8eb89b8705f9c9b31

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

class Scraper

  def self.scrape_website_poses
    doc = Nokogiri::HTML(open("https://www.self.com/gallery/de-stressing-yoga-poses-to-help-you-calm-down"))
     
    names = doc.css("figcaption h2.gallery-slide-caption__hed span.gallery-slide-caption__hed-text").map do |pose_el|
      pose_el.text
    end
     
    descriptions = doc.css("figcaption div.gallery-slide-caption__dek-container div.gallery-slide-caption__dek div").map do |caption_el|
      caption_el.text
    end
    
    names.each_with_index do |name, index|
      YogaPose.new(name, descriptions[index])
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stress_release_yoga-0.1.0 lib/scraper.rb