From: mortee Date: 2007-10-31T05:13:15+09:00 Subject: Re: HTML parser Hpricot? and how to get all text SpringFlowers AutumnMoon wrote: > by the way > > > require 'hpricot' > > doc = Hpricot("hello world") > > p doc.search("").inner_text > > > won't work... i am not sure if it is the Win installer of Ruby... but it > is the most recent Win installer. > > it says > > > scraper2.rb:6: undefined method `inner_text' for > # > (NoMethodError) > > and doc.to_plain_text() won't work either... > $ uname -s CYGWIN_NT-5.1 $ gem list hpricot *** LOCAL GEMS *** hpricot (0.6, 0.5) a swift, liberal HTML parser with a fantastic library $ irb irb(main):001:0> require 'hpricot' => true irb(main):002:0> d = Hpricot("hello world") => # "hello " {elem "world" } }> irb(main):003:0> d.inner_text => "hello world" ------------------------------------------------------------------- C:\>systeminfo ... OS Name: Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600 ... C:\>gem list hpricot *** LOCAL GEMS *** hpricot (0.6, 0.5, 0.4) a swift, liberal HTML parser with a fantastic library C:\>irb irb(main):001:0> require 'hpricot' => true irb(main):002:0> d = Hpricot("hello world") => # "hello " {elem "world" } }> irb(main):003:0> d.inner_text => "hello world" mortee