Hi
I am a newbie wrt javascript/perl.
I am trying to use perl to login to the playboy website :-)
where I have a *legal* paid subscription.
It uses a javascript based login and I am using WWW::Mechanize
The code I am using is as follows
***********************************
use LWP::UserAgent;
use HTTP::Cookies;
use WWW::Mechanize;
my $start_page = 'https://secure2.playboy.com/security/loginStart.do?s
+c_target=cyber.playboy.com';
my $mech = WWW::Mechanize->new();
my $mech = WWW::Mechanize->new( cookie_jar => "lwpcookies.txt");
my $mech = WWW::Mechanize->new( agent=>"Mozilla/5.0 (X11; U; Linux i68
+6; en-US; rv:1.7) Gecko/20040918 Firefox/0.9.3 " );
$mech->get( $start_page );
if ($mech->success()==1) {
print "Success \n";
}
$mech->submit_form(
form_name => 'loginForm',
fields => {
username => 'xxxx',
password => 'xxxx',
savedPWAction => 'on',
submitButton => 'ENTER THE CLUB'
}
);
#$mech->click_button(name => 'submitButton');
#$button='submitButton';
$mech->click;
$result = $mech->success();
if ($result == 1){
print "Success";
}
else {
print "Fail";
}
When I do use this script I get a success for the first part but I cant seem to post the username and passwrd. I get the following error msg.
Can't call method "click" on an undefined value at /usr/lib/perl5/site_perl/5.8.4/WWW/Mechanize.pm line 683.loading the page but I get an error
Can someone please help.
Thank you