Skip to content

Instantly share code, notes, and snippets.

@ericat
Created December 13, 2013 19:51
Show Gist options
  • Save ericat/7950230 to your computer and use it in GitHub Desktop.
Save ericat/7950230 to your computer and use it in GitHub Desktop.
Scraping an XML file with Nokogiri
require 'nokogiri'
require 'rubygems'
doc = Nokogiri::XML(File.open("path-to-file-sitemap.xml"))
doc.xpath('//xmlns:loc').each do |item|
puts item.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment