Skip to content

Instantly share code, notes, and snippets.

@apeiros
Created August 1, 2012 15:16
Show Gist options
  • Save apeiros/a27c3dceec251b8e18ec to your computer and use it in GitHub Desktop.
Save apeiros/a27c3dceec251b8e18ec to your computer and use it in GitHub Desktop.
require 'nokogiri'
require 'open-uri'
url = "http://www.london2012.com/medals/medal-count/index.html"
table = Nokogiri::HTML(open(url)).at_css("table.overall_medals")
rows = table.css('tbody tr')
data = rows.map { |row|
# …get data from the row…
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment