This library offers an easy way to handle xml. ex) xml_simple.html.body.div{|e| e[:class] =~ /strong\d/}.a[:href]