From: Paul Lutus Date: 2006-12-14T02:20:06+09:00 Subject: Re: Hpricot html parsing Dhanasekaran Vivekanandhan wrote: > yes, I want the text of the first

because it > has an image. and reject if

has no image. Hpricot might be able to do this, but you can also do it on your own, and know why the solution works. --------------------------------------- #!/usr/bin/ruby -w data = File.read("test.html") array = data.scan(%r{

([^<]+?)

}) p array --------------------------------------- Input text:

don't want this text

want this text

don't want this text either

want this text too

Output: [["want this text"], ["want this text too"]] -- Paul Lutus http://www.arachnoid.com