I want to login to a persian blogging service . This is my code:
#!/usr/bin/perl
use WWW::Mechanize;
$mech = WWW::Mechanize->new();
$url = \"http://blogfa.
This should work:
my $mech = WWW::Mechanize->new();
$mech->get("http://blogfa.com/Desktop/Login.aspx?t=1");
$mech->submit_form(
with_fields => {
'master$ContentPlaceHolder1$Uid' => 'my username',
'master$ContentPlaceHolder1$Password' => 'my password',
},
button => 'master$ContentPlaceHolder1$btnSubmit',
);
The problem is, that WWW:Mechanize does not execute javascript. Since the site you want to log in uses javascript for logging in, its not able to do that.
You could fix that problem by using WWW::Mechanize::Firefox, which allows you to execute javascript.