From: Nikita Ratlos Date: 2008-12-11T03:19:52+09:00 Subject: extracing the URL from hpricot element I want to get a list of URLs from a webpage as follows: First I create the Hpricot element as follows doc = Hpricot(open(searchurl)) links = doc/"//html//body//div[6]//div[2]//a[@id='p-1']" +# Next I want to append the URLs to an array as such: results << links.map.each{|link| puts link.attributes['href'] } The line nicely prints out the URLs how I need them, but then puts the whole HTML link in the results array. Any ideas how to get the URLs (without the HTML) into my results array ? -- Posted via http://www.ruby-forum.com/.