From: Ron Jeffries Date: 2002-01-16T06:54:03+09:00 Subject: Re: grabbing stuff from web pages On Tue, 15 Jan 2002 16:02:41 GMT, Niklas Frykholm wrote: >[Pierre-Charles David]: >> I have not tested it, but RAA contains a library called WebFetcher >> which is designed to ease this kind of things. I don't know if it will >> solve the 'Error 302' issue though. > >Yes it does. I'm the author so I should know ;) > >Here is a webfetcher script for downloading the cover image: > > require 'webfetcher' > > url = 'http://www.amazon.com/exec/obidos/ASIN/0201708426/' > im = WebFetcher::Page.url(url).images.find {|i| i.url['MZ']}.save('cov.jpg') > >If you want to try the module you can get the latest version (0.5.3) >here: > > http://www.acc.umu.se/~r2d2/programming/ruby/webfetcher/ Did that, but it doesn't work on my machine ... says this: GET http://www.amazon.com/exec/obidos/ASIN/0201708426/ /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:413:in `fetch_1_1': undefined method `response' for # (NameError) from /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:365:in `fetch' from /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:441:in `resp' from /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:456:in `html?' from /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:578:in `extract' from /cygdrive/c/ruby/lib/ruby/site_ruby/1.6/webfetcher.rb:656:in `images' from C:\Data\Ruby\CodeManager\workspace3.rb:4 Tool completed with exit code 1 Advice will be most welcome! Ronald E Jeffries http://www.XProgramming.com http://www.objectmentor.com I'm giving the best advice I have. You get to decide whether it's true for you.