Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Cannot re-enter username, password into login form

by GlassKnees (Initiate)
on Aug 02, 2014 at 00:44 UTC ( [id://1095986]=note: print w/replies, xml ) Need Help??


in reply to Re: Cannot re-enter username, password into login form
in thread Cannot re-enter username, password into login form

I'm using WWW::Mechanize

Here is a snippet of code:
$mech->get($url); $mech->form_name('loginform'); $mech->set_fields(user_login => $username, user_pass => $password); $mech->click(); my $output_page = $mech->content(); if ($output_page =~ m/cookies/) { $TestStatus = 1; ok( $TestStatus , "Login failed - Browser not enabled to accept co +okies error"); # Try logging in again - should work this time... $mech->get($url); $mech->form_name('loginform'); $mech->set_fields(user_login => $username, user_pass => $password); $mech->click(); }

The first attempt fails and I get the cookies error, which tells me that I'm populating the user_login and user_pass fields. But after invoking the click method, I can't seem to repopulate the fields - at least that's how the site is behaving...

Replies are listed 'Best First'.
Re^3: Cannot re-enter username, password into login form
by Anonymous Monk on Aug 02, 2014 at 07:17 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-19 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found