Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My code is below.<form name="aspnetForm" method="post" action="/account/sign-in.asp +x" id="aspnetForm"> <input class="JA_field" type="text" id="JA_email" name="email" maxlen +gth="75" value="" tabindex="1" /> <input class="JA_field" type="password" id="JA_password" name="passwor +d" maxlength="75" tabindex="5" /> <input class="JA_radio" type="radio" id="JA_returning" name="sign_in_ +type" value="returning" tabindex="3" checked="checked"/>
use WWW::Mechanize; my $email = ''; my $password = ''; my $ja_login = 'http://www.justanswer.com/login.asp'; my $answer_page = 'http://www.justanswer.com/expert/question-list.aspx +'; my $confirm_signon = 'My Questions'; print header, start_html("JA"); my $mech = WWW::Mechanize->new(agent => 'InternetExplorer 8'); my $login_get = $mech->get($ja_login); $mech->submit_form( form_name => 'aspnetForm', fields => { email => $email, password => $password, sign_in_type => 'returning',}, ); if ($mech->content !~ m/$confirm_signon/) { print "Failed to sign on"; print $mech->content; exit; } $mech->get($answer_page); print $mech->content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize won't sign me in
by Anonymous Monk on May 26, 2011 at 11:20 UTC |