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

Hi Monks !
Is it possible to use Firefox's cookies to access captcha protected website ( with LWP/Mechanize ) ?
Thanks !
  • Comment on Is it possible to use other browser's cookies ?

Replies are listed 'Best First'.
Re: Is it possible to use other browser's cookies ?
by dsheroh (Monsignor) on Jul 14, 2007 at 16:36 UTC
    It should be, so long as you know where the file Firefox stores them in is. Take a look at LWP::UserAgent's cookie_jar. (It's been quite a while since I last needed to do this, but I'm pretty sure that was how I did it.)
      I found the cookie file , but when I run the script , HTTP::Cookies complains about the file :

      /root/.mozilla/firefox/y71ji1db.default/cookies.txt does not seem to contain cookies at /usr/lib/perl5/site_perl/5.8.8/HTTP/Cookies.pm line 426, <FILE> line 1.
        This is a symptom of that your perl process cannot read the cookies files, judging from the path, probably because of lacking permission.

        Security advice: Don't browse the web as root, ffs! Use a normal user account.