Skip to content

Instantly share code, notes, and snippets.

@HudsonAfonso
Created January 17, 2014 18:48
Show Gist options
  • Save HudsonAfonso/8479165 to your computer and use it in GitHub Desktop.
Save HudsonAfonso/8479165 to your computer and use it in GitHub Desktop.
:D
require 'mechanize'
require 'awesome_print'
agent = Mechanize.new {|agent| agent.user_agent = Mechanize::AGENT_ALIASES['Mac FireFox']}
page = agent.get('http://www.creativelive.com/catalog/all')
_course = page.search('.course-tile-title').collect{|i| i.text.strip}
_instructors = page.search('.course-tile-instructors').collect{|i| i.text.gsub('with','').gsub(/\s+/, ' ').strip}
ap Hash[_course.zip(_instructors)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment