Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 371 Bytes
require 'nokogiri'
require "FasterCSV"
def parse_year(year)
doc = Nokogiri::HTML(open("original/#{year}.html"))
rows = (doc/"body/table[2]/tr/td[2]/table/tr")
FasterCSV.open("raw/#{year}.csv", "w") do |csv|
rows.each {|row| csv << parse_row(row)}
end
end
def parse_row(row)
(row/"td").map{|e| e.content}
end
(1880..2008).each{|year| parse_year(year)}
Something went wrong with that request. Please try again.