From: Albert Schlef Date: 2009-12-27T12:51:45+09:00 Subject: Re: Extracting some text from HTML Albert Schlef wrote: > I'm using Nokogiri. > > I have the following HTML: > > ... >
>
blah blha blah
>
blah blah blah
> > ...some text I want to extract... > >
whatever
>
> ... > > How can I extract the text "...some text I want to extract..." ? I solved the problem. I used the following code: the_text_i_want = doc.at_xpath('//div[@class="lead"]/text()[3]') puts the_text_i_want.content -- Posted via http://www.ruby-forum.com/.