I wrote some code with help from examples but when I run it I'm getting error in Ubuntu Server 12.04.2 LTS:
Failed to connect to , problem connecting to "localhost", port 4242: Connection refused at /usr/local/share/perl/5.14.2/MozRepl/Client.pm line 144
How can i fix this ?
#!/usr/bin/perl -w
use strict;
use WWW::Mechanize::Firefox;
use HTTP::Cookies;
my $username = "test";
my $password = "t3st";
my $mech = WWW::Mechanize::Firefox->new();
$mech->get("http://test.com/login.php"); print "Logging, Please Wait.\n";
$mech->submit_form(
form_number => 0,
fields => {
username => "$username",
password => "$password",
}
);