Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Cookies issue with www::Mechanize

by Matt™ (Acolyte)
on Oct 17, 2012 at 10:32 UTC ( #999515=perlquestion: print w/replies, xml ) Need Help??
Matt™ has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, Need your Help!

I am using Mechanize to automate this URL but I am not getting the full contents( jobs available there)of that page while saving. I think some cookie issue or something is there, but i cant find(figure) it out. Pls suggest Monks. Looking for your help! Thanks in advance Monks.


Pls find the code below,

use strict; use WWW::Mechanize; my $search_url = " +aspx?partnerid=25510&siteid=5136"; my $mech = WWW::Mechanize->new( ); print "\nChecking: $search_url ...\n"; eval{ $mech->agent_alias('Mac Safari'); $mech->get($search_url); }; if ($@) { print "Error connecting to URL $search_url.\n($@)\n"; exit(1); } my $filename = 'OUTPUT.html'; $mech->save_content( $filename ); die;

Replies are listed 'Best First'.
Re: Cookies issue with www::Mechanize
by moritz (Cardinal) on Oct 17, 2012 at 11:28 UTC

    The URL seems to work fine without cookies. The data is just stored in a bit awkward way (as HTML-escaped JSON in an attribute of a <param> tag). Look at the source of the downloaded HTML file and see for yourself.

      Thanks Moritz, hope it will help me.

Re: Cookies issue with www::Mechanize
by zentara (Archbishop) on Oct 17, 2012 at 11:27 UTC

      Thanks Zentata, will check whether I can make it out... :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://999515]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2018-06-23 18:03 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.