On Thu, Oct 28, 2010 at 8:54 PM, Corey Watts <cwatts / westmont.edu> wrote: > Thanks! ¨Β εφεξτυαμμω γανε υπ χιτθ σονετθιξμιλε τθισ> > website = > page.search("//div[@class='listing_content']/ul[@class='features']/li[1]") Wouldn't it be better to first search for all div with class=listing_content and then extract data for that single listing from there? > # initializes the link variable with something > link = "super" "link = nil" is sufficient. > # The segment below grabs the URL of the listing's website, if it has > one. ¨Βτθεςχισε ιτ > # puts 'nil' into the link variable > if website.inner_text() == "Website" You can use my XPath to find those links. > ebsite.search("a").map do |l| #map is nonsense here - you only need #each. > ink = l['href'] > nd > else > ink = "nil" Didn't you mean "link = nil"? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/