From: Soichi Ishida Date: 2013-04-05T14:57:15+09:00 Subject: nested loop for xpath Rails 1.9.3 I am scraping a web page, http://en.wikipedia.org/wiki/List_of_birds_by_common_name using Nokogiri and Xpath I want all the names of the birds listed there. xpath1 = '//div[@id='bodyContent']/div[@id='mw-content-text']/ul[1]' should get a group of birds Great Tinamou Andean Tinamou Elegant Crested Tinamou Little Tinamou Slaty-breasted Tinamou Thicket Tinamou I need to get each one of these names and tried nested loop xpath1 = '//div[@id='bodyContent']/div[@id='mw-content-text']/ul' doc = Nokogiri::HTML(open(url)) categories = doc.xpath(xpath1) categories.each do | c | c.xpath('/li').each do | n | p n.text end end gives empty values. Can anyone tell why? or are there better ways? soichi -- Posted via http://www.ruby-forum.com/.