in reply to Logon Faied

Start with WWW::Mechanize and mind the WWW::Mechanize::FAQ

Alsouse (firefox) to click it, and examine what firefox sends, Use http://WireShark.org or LiveHTTPHeaders to figure out what works from the browser and send something like that using Mechanize ( you can automate this using HTTP::Recorder, Web Testing with HTTP::Recorder ) ,... or use WWW::Mechanize::Firefox, it drives firefox underneath

Replies are listed 'Best First'.
Re^2: Logon Faied
by Prashanth Sethalli (Initiate) on Mar 03, 2014 at 16:26 UTC

    Hi I have now using Mechanise and I get the following error.. PLEASE HELP I HAVE ADDED DEBUG INFORMATION ALSO

    C:\myperl>perl Mech.pl $VAR1 = 'eosftn', 'lgpwdh', 'eossbftn', 'lgid', 'lgpswd' ;

    Cache-Control: no-cache="set-cookie, set-cookie2" Connection: close Date: Mon, 03 Mar 2014 16:19:14 GMT Server: Sun-ONE-Web-Server/6.1 Content-Language: en-US Content-Type: text/html;charset=ISO-8859-1 Expires: Thu, 01 Dec 1994 16:00:00 GMT Client-Date: Mon, 03 Mar 2014 16:19:14 GMT Client-Peer: 171.197.163.162:80 Client-Response-Num: 1 Link: <style/news_styles.css>; rel="stylesheet"; type="text/css" Set-Cookie: JSESSIONID=00005gaiknLGdCJtu4uHOjs8SHo:176tso1vn; Path=/; HttpOnly Set-Cookie: BIGipServernews=1370667691.54646.0000; path=/ Title: X-Powered-By: Servlet/3.0

    POST http://news.bankofamerica.com/EOS/EosDispatcher login1 eosftn=logent (hidden readonly) lgpwdh= (hidden readonly) eossbftn= (hidden readonly) lgid= (text) lgpswd= (password) <NONAME>=Login (submit) No clickable input with name Login at C:/Perl/lib/WWW/Mechanize.pm line 1707.

    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();