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

Fellow Monks !

I'm using the module HTTP::GetImages in order to extract PNG files from web page, the problem is that I need somehow to use cookie when I open the session, otherwise I'm getting no images.

For example, when I do it with Wget I specify the cookie as follows:
"wget -Epk --load-cookies /root/.mozilla/firefox/n3nkngb1.default/cookies.txt http://...html"

Does anyone now how can I use cookie with HTTP::GetImages ?
Maybe other module can do the job ?

Thanks,
MoshMonk.

Replies are listed 'Best First'.
Re: cookie with HTTP-GetImage
by arkturuz (Curate) on May 11, 2006 at 08:41 UTC
    Use LWP. It supports cookies.

    BTW, HTTP-GetImage doesn't sound as Perl module. I couldn't find it on CPAN. Where did you get it?

      It is a CPAN module:

      http://search.cpan.org/~lgoddard/HTTP-GetImages-0.343/GetImages.pm

      How can I get images from a web page using LWP ?

      I went over the docs, there's no option like that.

      mosh

        You can get it as any other document addressed by URI. So if you have a HTML code of a web page with the desired image, extract the link to an image and pass it to LWP to fetch it in the same way as you would fetch that first web page.