From: Lex Williams on
i'm not really sure about hpricot , but with html/tree parser , when you
call a node's to_s method , you got it's full html . So , you should try
to call .to_s on the array's elements , and see if it's what you need.
--
Posted via http://www.ruby-forum.com/.

From: Newb Newb on
Jan Pilz wrote:
> Newb Newb schrieb:
>>> require 'open-uri'
>> doc = Hpricot.parse(item.description)
>> imgs = doc.search("//img")
>> @src_array = imgs.collect{|img|img.attributes["src"]}
>>
>> but it gives only the Image Url's but I need to Get
>> <img src =" "> tag Fully ...
>> Any Helps
>>
> Then do
>
> @src_array = imgs.collect{|img| "<img src =\"#{img.attributes["src"]
> }\">" }
>
> ?
>

yes It works..
Is It Possible to Use @src_array into String.sub!(pattern,replacement)
That is

@src_array.sub(/[@src_array]/," ")


@src_array contains all the img tags.i need to replace it empty...
for that will tat above code work?
can u get me there?


>
> --
> Otto Software Partner GmbH
>
> Jan Pilz (e-mail: Jan.Pilz(a)osp-dd.de)
>
> Tel. 0351/49723202, Fax: 0351/49723119
> 01067 Dresden, Freiberger Straße 35 - AG Dresden, HRB 2475
> Geschäftsführer: Burkhard Arrenberg, Heinz A. Bade, Jens Gruhl

--
Posted via http://www.ruby-forum.com/.