Created
May 10, 2013 01:53
-
-
Save ashleygwilliams/5551908 to your computer and use it in GitHub Desktop.
Here's the code from Tom's talk! If you have more questions, you should tweet @ThomasLevine
This file contains 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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
download = open("http://www.dol.gov/olms/regs/compliance/cba/Cba_CaCn.htm") | |
html = Nokogiri::HTML(download) | |
tables = html.search("table") | |
table = tables[1] | |
table.search('tr')[1..4].each do |tr| | |
tr.search('td').each do |td| | |
puts td.text | |
end | |
end | |
# References | |
# | |
# http://talks.thomaslevine.com/news-hack-day-sf/#cheatsheet | |
# https://scraperwiki.com/scrapers/unionreports/edit/ | |
# https://scraperwiki.com/docs/ruby/ | |
# https://scraperwiki.com/docs/ruby/tutorials/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment