Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Cookiejar for www::mechanize

by Aragorn (Curate)
on Jun 16, 2004 at 07:49 UTC ( #367135=note: print w/ replies, xml ) Need Help??


in reply to Cookiejar for www::mechanize

You can create an in-memory cookie jar using the constructor of WWW::Mechanize. Using an existing cookie jar, you can use the HTTP::Cookies module. The file format this module uses is different from, for example, Mozilla. You can use HTTP::Cookies::Netscape or HTTP::Cookies::Explorer to read these browser-specific files.

Using an existing file of cookies with WWW::Mechanize can be done as follows:

... my $agent = WWW::Mechanize->new(); my $cj = HTTP::Cookies->new(file => "/file/to/cookie_jar"); $agent->cookie_jar($cj); ...
(Substitute HTTP::Cookies::Netscape or HTTP::Cookies::Explorer to use a cookie file from those browsers.

Arjen


Comment on Re: Cookiejar for www::mechanize
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://367135]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2015-07-28 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls