From: chickenkiller Date: 2007-04-13T20:45:08+09:00 Subject: Re: Hpricot innerTEXT? On Apr 13, 12:10 pm, Bontina Chen wrote: > Lionel Orry wrote: > > On Apr 13, 10:11 am, Bontina Chen wrote: > >> morwyn > > >> but I got > >> Posted viahttp://www.ruby-forum.com/. > > replace innerTEXT by inner_html: > > > (doc/"item").each do |t| > > puts (t/"dc:subject").inner_html > > end > > > regards > > Lionel > > Thx for your response , but I still get > html internet tutorial web > > -- > Posted viahttp://www.ruby-forum.com/. In fact, inner_text works as well. But you should have a look at the warnings from ruby! The inner_text or inner_html function is applied to 'puts (t/"dc:subject")' return object, which is nil. So a warning appears: rdf.rb:6: undefined method `inner_html' for nil:NilClass (NoMethodError) but 'puts (t/"dc:subject")' is executed, and so 'html internet tutorial web' is displayed anyway. Therefore I recommend using a few parentheses there: puts((t/"dc:subject").inner_text) and it should work well this time. Next time, look at the warnings!!! ;) regards Lionel