From: Love U Ruby Date: 2013-04-15T04:41:54+09:00 Subject: Re: Why does #content method in nokogiri not printing the full text? Finally I got the output what I was looking for: require 'nokogiri' require 'pp' html = <<-END A Dirge

                Rough wind, that moanest loud
                  Grief too sad for song;
                Wild wind, when sullen cloud
                  Knells all the night long;
                Sad storm, whose tears are vain,
                Bare woods, whose branches strain,
                Deep caves and dreary main, -
                  Wail, for the world's wrong!

        
END doc = Nokogiri::HTML::DocumentFragment.parse(html) doc.children.each do |ch| puts ch.child.content if ch.node_name == 'pre' end output: ======= Rough wind, that moanest loud Grief too sad for song; Wild wind, when sullen cloud Knells all the night long; Sad storm, whose tears are vain, Bare woods, whose branches strain, Deep caves and dreary main, - Wail, for the world's wrong! -- Posted via http://www.ruby-forum.com/.