Created
November 27, 2012 13:12
-
-
Save Usse/4154171 to your computer and use it in GitHub Desktop.
Web crawler examples with ruby and Nokogiri
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
# | |
# Web crawler examples | |
# | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
page = Nokogiri::HTML(open("http://news.ycombinator.com/")) | |
elems = page.css('table .title a') | |
elems.each {|item| puts item.text} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment