Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Error! Clone on unblessed reference

by Agyeya (Hermit)
on May 26, 2004 at 08:26 UTC ( [id://356492]=note: print w/replies, xml ) Need Help??


in reply to Error! Clone on unblessed reference

The problem with my above code (if I am not wrong) is that
1) I have used two modules - WWW::Mechanize and HTTP::Request.
2) I have set the cookie with the HTTP::Request module and downloaded the web page by the Mechanize object.
It is for this reason that my downloaded page was showing "Your session has expired."

I have made some changes to my program but still the problem persists.(session expired)
The complete changed program is as below.
#!/usr/bin/perl # Stats.plx use warnings; use strict; use WWW::Mechanize; use File::Basename; use DBI; use Date::Manip; use Template::Extract; use Data::Dumper; my $agent; $agent = WWW::Mechanize->new( autocheck => 1 ); $agent->get("http://www.abc.com/ChooseZone.aspx?type=A"); print "Making HTTP Post Request....\n"; $agent->get("http://www.abc.com/ChooseZone.aspx?type=A &__EVENTTARGET= +rdlZone_0 &__EVENTARGUMENT= &__VIEWSTATE='dDw0NzUyOTE0NzQ7dDw7bDxpPDE ++Oz47bDx0PDtsPGk8MT47aTwzPjs+O2w8dDw7bDxpPDA+Oz47bDx0PDtsPGk8MD47Pjts +PHQ8O2w8aTwwPjtpPDE+Oz47bDx0PDtsPGk8MT47PjtsPHQ8cDxwPGw8VGV4dDs+O2w8U +GxlYXNlIFNlbGVjdCB0aGUgQ29uc3VsYXIgRGlzdHJpY3QgdGhhdCBjb3ZlcnMgeW91ci +BSZXNpZGVuY2U7Pj47Pjs7Pjs+Pjt0PDtsPGk8MT47PjtsPHQ8cDxwPGw8VGV4dDs+O2w +8VFQgU2VydmljZXMgLSBXZWIgQXBwbGljYXRpb247Pj47Pjs7Pjs+Pjs+Pjs+Pjs+Pjt0 +PHQ8O3A8bDxpPDA+O2k8MT47aTwyPjs+O2w8cDxcPC90ZFw+XDx0ZCB3aWR0aD0nMjUlJ +2NsYXNzPSdCb2R5VGV4dCdcPlw8Ylw+VVMgQ29uc3VsYX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Pjs+Pjs+Pjs+ES4L3Lspg +y7Nq0zptOk6nJmcTfM=' &rdlZone = 1"); $agent->get("http://www.abc.com/CalendarDisp.aspx",":content_file" => +"cal.html" );
Please suggest, esteemed monks!!

Replies are listed 'Best First'.
Re: Re: Error! Clone on unblessed reference
by castaway (Parson) on May 26, 2004 at 10:34 UTC
    Surely if that VIEWSTATE is a cookie you want to set it dynamically, and not with a fixed value? Thats probably what has expired..

    (Unless Im missing something, and WWW::Mechanize does cookie stuff behind the scenes that Im not aware of - did you check?)

    C.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found