Skip to content

Instantly share code, notes, and snippets.

@dustMason
Created December 30, 2013 02:29
Show Gist options
  • Save dustMason/8177107 to your computer and use it in GitHub Desktop.
Save dustMason/8177107 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
base_uri = "http://www.thefremontproject.com"
path = "/rabbithole"
loop do
html = open(base_uri + path).read
link = Nokogiri::HTML(html).at_css("#next-link")
open("rabbithole.html", "wb") { |file| file.write(html) }
if link && link.start_with?("/") then path = link['href'] else break end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment