Created
February 19, 2015 15:37
-
-
Save carlocasorzo/f1976146ab7290e243fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mechanize' | |
agent = Mechanize.new | |
agent.get('http://masteringcoding.com/') | |
results = agent.page.search('.teaser-title a') | |
results.each { |result| puts "#{result.text} (#{result.attributes['href']})" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment