From: Robert Klemme Date: 2009-03-26T05:46:46+09:00 Subject: Re: Parsing xml On 25.03.2009 20:10, David Masover wrote: > require 'mechanize' > mech = WWW::Mechanize.new > mech.get 'http://www.shoe-g.com/index.rdf' > doc = Nokogiri(mech.page.body) > titles = (doc / 'title').map(&:text) Here's a similar solution using REXML: require 'open-uri' require 'rexml/document' body = open('http://www.shoe-g.com/index.rdf').read doc = REXML::Document.new body titles = doc.elements.to_enum(:each, '//title').map(&:text) Five lines as well... Cheers robert