use strict; use warnings; use HTTP::Request; use HTTP::Cookies; use WWW::Mechanize; use Data::Dumper; BEGIN { $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0 } #my $url="https://lonclsscwb01.emea.bankofamerica.com/paypluspce/Index.htm"; my $url="http://news.bankofamerica.com/EOS/EosDispatcher"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); my @forms=$mech->forms; foreach my $form (@forms) { my @inputfields = $form->param; print Dumper \@inputfields; } print $mech->dump_headers(); print $mech->dump_forms(); $mech->form_name('login1'); $mech->field ('lgid' => ''); $mech->field ('lgpswd' => ''); #my $result = $mech->submit_form( #form_name => 'login1', #name of the form #instead of form name you can specify #form_number => 1, #fields => #{ # lgid => '', # name of the input field and value # lgpswd => '', #} #,button => 'btnLogin' #name of the submit button #); #print $mech->current_form(); $mech->click('Login'); #print $mech->content();