in reply to Re: Help with logging in to a tricky ASP web form with JavaScript using WWW::Mechanize
in thread Help with logging in to a tricky ASP web form with JavaScript using WWW::Mechanize
Hey you know what? I did go ahead and look more closely at the headers after your post and I had been using a non-URL-decoded value for a parameter called ctl00_ContentPlaceHolder1_ctl00_rcbusertype_ClientState. The encoded value was
%7B%22logEntries%22%3A%5B%5D%2C%22value%22%3A%22Subscriber%22%2C%22text%22%3A%22Subscriber%22%2C%22enabled%22%3Atrue%7D
and I used http://meyerweb.com/eric/tools/dencoder/ to decode it so now the following works:
I like computer programming because it's like Legos for the mind.
!$mech->set_fields( 'ctl00$ContentPlaceHolder1$ctl00$rcbusertype_Input' => "Su +bscriber", 'ctl00$ContentPlaceHolder1$ctl00$txtUserName' => $un, 'ctl00$ContentPlaceHolder1$ctl00$txtPassword' => $pw, ctl00_ContentPlaceHolder1_ctl00_rcbusertype_ClientState => '{"logEntries":[],"value":"Subscriber","text":"Subscriber" +,"enabled":true}' ); my $response = $mech->click_button( name => 'ctl00$ContentPlaceHolder1$ctl00$L +oginButton', x=>26, y=>10 );
I like computer programming because it's like Legos for the mind.
|
---|
In Section
Seekers of Perl Wisdom