From: Jan Pilz Date: 2008-08-21T20:41:12+09:00 Subject: Re: REGEXP HELP Newb Newb schrieb: > Thomas Wieczorek wrote: > >> On Thu, Aug 21, 2008 at 12:50 PM, Lex Williams wrote: >> >>> Instead of using a regular expression you could consider a html parser , >>> and/or do a xpath search to retrieve images. Check hpricot . >>> >>> >> Yeah, it is quite easy with Hpricot: >> >> require 'open-uri' >> require 'hpricot' >> >> site = >> Hpricot(open("http://code.google.com/edu/submissions/SedgewickWayne/index.html")) >> site.search("//img") #=> returns an array of all images >> > > > > yes i used as this > 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 > tag Fully ... > Any Helps > Then do @src_array = imgs.collect{|img| "" } ? -- Otto Software Partner GmbH Jan Pilz (e-mail: Jan.Pilz@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