PerlJam has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to grab all the images from a websites directory. The site has a page that links to all the images in this directory. Now after trying a few things with Image::Grabber I am finding (at least I believe) that the page must display the image in order for the image to be grabbed. Otherwise it returns an "unable to find absolute path" error. Is there a trick I can pull to grab the images from a directory using Image::Grabber (i.e. regular expression in the search_url instead of using regexp) or should I be using LWP:Simple or such. The page I am testing this on is http://www.poop.com/pics/index.html (actually some funny stuff here).

I hope this hasn't been answered before. I super searched and found no solutions discussing directory downloads. Anyways, any help is appreciated
----
Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated failures. Persistence and determination alone are omnipotent. --Calvin Coolidge (1872-1933)
  • Comment on Using Image::Grabber to grab images from a directory

Replies are listed 'Best First'.
Re: Using Image::Grabber to grab images from a directory
by Beatnik (Parson) on Apr 21, 2001 at 16:04 UTC
    Using HTML::SimpleLinkExtor & LWP::Simple
    #!/usr/bin/perl -w use strict; use HTML::SimpleLinkExtor; use LWP::Simple; my $html = get("http://www.poop.com/pics/index.html"); my $extor = HTML::SimpleLinkExtor->new(); $extor->parse($html); @img_srcs = $extor->img;
    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
      I'm a newb.. so this may or may not be the place for this... When I try to install the SimpleLinkExtor package (for this example), I built the makefile, but then when i try to do 'make SimpleLinkExtor.pm', I get: "Fatal makefile 654: No terminator specified for in-line file operator" The makefile is generated though, it's not like i created it... I tried looking for spaces instead of tabs, but didn't find any. PS.. I'm running Win2k, and ActiveState Perl... if that matters.