class Scraper

Public Class Methods

scrape_events() click to toggle source
# File lib/stem-for-women/scraper.rb, line 14
def self.scrape_events
  page = Nokogiri::HTML(open("https://www.wisecampaign.org.uk/what-we-do/wise-events/"))
  page.css("div.upcoming-events-content-box .upcoming-events-box").collect do |event|
    {
      title: event.css("div.heading-box").text.strip,
      date: event.css("div.event-time-box p")[0].text,
      time: event.css("div.event-time-box p")[1].text,
      website: event.css("div.heading-box a").attribute("href").value,
      description: event.css("div.text-box p").text
    }
  end
end
scrape_scholarships() click to toggle source
# File lib/stem-for-women/scraper.rb, line 3
def self.scrape_scholarships
  page = Nokogiri::HTML(open("https://www.wisecampaign.org.uk/wise-network/funding/"))
  page.css("div.list-items-box .list-item").collect do |scholarship|
    {
      title: scholarship.css("div.header-box").text.strip,
      website: scholarship.css("div.header-box a").attribute("href").value,
      description: scholarship.css("div.description-box p").text,
    }
  end
end