Skip to content

Instantly share code, notes, and snippets.

@Usse
Created November 27, 2012 13:12
Show Gist options
  • Save Usse/4154171 to your computer and use it in GitHub Desktop.
Save Usse/4154171 to your computer and use it in GitHub Desktop.
Web crawler examples with ruby and Nokogiri
#
# 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