On Wed, Jun 23, 2010 at 12:23 AM, Pen Ttt <myocean135 / yahoo.cn> wrote:
> there is a =A0simple file /home/pt/test.html such as the following
>
> <html>
>
> <body>
>
> <p>
>
> <br>
> =A0 =A0hallo,world
>
> =A0<br />
>
> </p>
>
> </body>
>
> </html>
>
> i want to extract the text "hallo,world" in the /home/pt/test.html =A0wit=
h
> nokogiri,how to write?
>
> require 'rubygems'
> require 'nokogiri'
> html =3D '/home/pt/test.html'
> doc =3D Nokogiri::HTML(html)
>
> would you mind to finish it ?

At http://wiki.github.com/tenderlove/nokogiri/ you can read on how to
find the nodes you need. I think you'll need to use xpath.

Bye


--=20
Luis Parravicini
http://ktulu.com.ar/blog/