Subject: | how do I get beyond that dammned meta="Refresh" page ?? |
Date: | Wed, 22 Nov 2006 14:28:18 +0100 |
To: | bug-WWW-Mechanize [...] rt.cpan.org |
From: | "Carl A. Schreiber" <gooly [...] gmx.at> |
Hi,
I want to login somewhere to get the state of my account.
The address of this acct.-page is just
https://myaccount.server.com/clx/index.php?part=menu&justloggedin=true
I use WWW::Mechanize, but I end up at a page with
<meta http-equiv="Refresh"
content="0;url=index.php?part=menu&justloggedin=true">
Now I either loose the session, or I just reload exatly this page.
How, the hell, can I go beyond this page, which shows I am successfully
logged in
use WWW::Mechanize;
my $m = WWW::Mechanize->new( agent => 'Linux Konqueror' );
$m->get( $url );
$r = $m->success or die "Can't get this url $url\n\n";
# login-Page is loaded ..
my $r = $m->submit_form(
fields => {
$user => $uNme,
$pwd => $pPwd
}
);
die "Couldn't submit form" unless $r->is_success;
# Login was successfull here !!
print $r->content # prints this
#<html><head>
#<meta http-equiv="Refresh"
#content="0;url=index.php?part=menu&justloggedin=true">
#</head><body><a
#href="index.php?part=menu&justloggedin=true"></a></body></html>
If I do one of these I loose the session (need to re-login):
$m->follow_link(n=>0);
$m->follow_link(n=>1);
If I try to create the url by my self by
Step 1:
print join('; ',@{${$m->links()}[0]}),"\n\n";
print join('; ',@{${$m->links()}[1]}),"\n";
this gives me:
index.php?part=menu&justloggedin=true; ; ; meta; https://myaccount.ser
+ver.com/clx/index.php; HASH(0x864c5f8)
index.php?part=menu&justloggedin=true; ; ; a; https://myaccount.server
+.com/clx/index.php; HASH(0x86168bc)
So I just try:
$m->get( 'https://myaccount.server.com/clx/index.php?part=menu&justloggedin=true' )
and the session is lost => re-login
And even what I have found on Active bugs for WWW-Mechanize
(http://rt.cpan.org/Public/Bug/Display.html?id=12882)
print $m->response->request->uri;
shows: https://myaccount.server.com/clx/index.php
and that:
$m->get ( $m->response->request->uri );
only reloads the first login-form and not what I want.
If I do a reload after submitting the form,
$m->reload();
it just reloads the meta="Refresh.. page.
Anybody with an idea how I can get beyond this "meta-page"?
Thanks a lot in advance;
Carl