Skip to content

Instantly share code, notes, and snippets.

@lukaselmer
Forked from yannick/parse.rb
Created May 11, 2011 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaselmer/967010 to your computer and use it in GitHub Desktop.
Save lukaselmer/967010 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
url = 'http://www.admin.ch/ch/d/sr/101/index.html'
doc = Nokogiri::HTML(open(url))
toc = doc.css('#spalteContentPlus')
layer1_links = toc.css('a').collect{|lnk| lnk["href"]}.select{|lnk| lnk.to_s.start_with? "./"}
layer1_links.each do |lnk|
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment