Skip to content

Instantly share code, notes, and snippets.

@ashleygwilliams
Created May 10, 2013 01:53
Show Gist options
  • Save ashleygwilliams/5551908 to your computer and use it in GitHub Desktop.
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
#!/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