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

Hello,

I'm writing a Perl script to automate the creation of an image database of grocery items from vons.com.

When I attempt to retrieve images from the vons.com search pages, it requires entering a zip code before yielding search results.

To get around this, I am currently using wget --load-cookies with my cookies.txt file from mozilla firefox, but it redirects me to the same page for entering the zip code. I suspect its a problem with session cookies, but I'm not sure. Are there any ways to store the session cookies to file so I can perform my image searches? Thanks in advance.

Replies are listed 'Best First'.
Re: Storing temporary session cookies
by fenLisesi (Priest) on Apr 28, 2007 at 09:03 UTC
Re: Storing temporary session cookies
by akho (Hermit) on Apr 28, 2007 at 12:21 UTC
    HTTP::Cookies will also help if you need to accept cookies with WWW::Mechanize.

    use WWW::Mechanize; my $cookies = HTTP::Cookies->new(autosave => 1, file => 'cookies.dat'); my $mech = WWW::Mechanize->new(autocheck => 1, cookie_jar => $cookies);

    then use $mechanize; it should have all the cookies from cookies.dat.