Hi Everyone
I am using the perl script but at the time of calling of this script it gives error at http::request::form.
Please if anyone could help me
Thanks.
=====================================
#!/usr/bin/perl -w
use strict;
use URI::URL;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Request::Common;
use HTTP::Request::Form;
use HTTP::Cookies;
use HTML::TreeBuilder 3.0;
use DBI;
my ($db_table, $db_user, $db_pass) = ("tab", "dbu", "pass");
my $url = "
https://abc.def";
my $ua = new LWP::UserAgent;
push @{ $ua->requests_redirectable }, 'POST';
$ua->cookie_jar(new HTTP::Cookies(file => "./cookies.txt"));
my $req = new HTTP::Request(GET $url);
my $res = $ua->request($req);
my $tree = new HTML::TreeBuilder;
$tree->parse($res->content);
$tree->eof();
my @forms = $tree->find_by_tag_name('FORM');
if(!@forms) {
die "No forms found";
}
my $form = new HTTP::Request::Form($forms[0], $url);
$form->field("{actionForm.username}", "user");
$form->field("{actionForm.password}", "password");
$res = $ua->request($form->press());