From: Love U Ruby Date: 2013-05-30T05:45:43+09:00 Subject: Re: Why does #content method in nokogiri not printing the full text? Hi, I wrote the below code: require 'nokogiri' require 'open-uri' doc = Nokogiri::HTML(open('http://www.homeshop18.com/')) p doc.css("div#megamenu-sub-nav li span:nth-child(2)").map{|x| x.parent.text.strip} #=> ["books", "clothing", "footwear", "fashion accessories", "health & beauty", "jewellery", "watches", "mobiles", "gsm mobiles\r\rnew", "upto 62% off\r\rnew", "camera & camcorders", "computers", "electronics", "home & kitchen", "household appliances", "kids & toys", "gift & flowers", "office & stationery"] But in the array output, I am getting 2 extra items - "gsm mobiles\r\rnew", "upto 62% off\r\rnew", which I don't expect. Could anyone tell me where I did the mistake. -- Posted via http://www.ruby-forum.com/.