From: "Bartosz DziewoƄski" Date: 2013-04-15T05:43:38+09:00 Subject: Re: Why does #content method in nokogiri not printing the full text? On Sun, 14 Apr 2013 18:19:00 +0200, Love U Ruby wrote: > doc = Nokogiri::HTML::DocumentFragment.parse(html) > doc.children.each do |ch| > p ch.content if ch.text? > end `ch.text?` will only return true when a node is a text node - ie., it's not a tag. Since the document root contains no text itself apart from whitespace, this just prints the whitespace. Remove the `if ch.text?` part to print contents of everything (or just use `doc.content`). -- Matma Rex