You can try something like this:

if p.search("img").length > 0
   puts p.inner_html
end


Dhanasekaran Vivekanandhan wrote:
> yes, I want the text of the first <p> because it
> has an image. and reject if <p> has no image.
> thanks,
> Dhanasekaran
> 
> -- 
> Posted via http://www.ruby-forum.com/.