Here is my simple code that I believe should be working and I'm unable to figure out why:$VAR1 = bless( { 'default_charset' => 'UTF-8', 'enctype' => 'application/x-www-form-urlencoded', 'accept_charset' => 'UNKNOWN', 'action' => bless( do{\(my $o = 'http://*_edit_*/proc +login')}, 'URI::http' ), 'method' => 'POST', 'attr' => { 'method' => 'POST', 'id' => 'fLogin' }, 'inputs' => [ bless( { 'value_name' => '', 'value' => '', 'name' => 'txtUserID', 'class' => 'TextInput', 'id' => 'txtUserID', 'type' => 'text', 'size' => '20' }, 'HTML::Form::TextInput' ), bless( { 'readonly' => 1, 'value_name' => '', 'value' => '', 'name' => 'sessionTermNum', 'id' => 'sessionTermNum', 'type' => 'hidden', 'size' => '20' }, 'HTML::Form::TextInput' ), bless( { 'value_name' => '', 'value' => '', 'onkeypress' => 'return vfnChe +ckKeyLogin(event);', 'name' => 'txtPassword', 'class' => 'TextInput', 'id' => 'txtPassword', 'type' => 'password', 'size' => '20' }, 'HTML::Form::TextInput' ), bless( { 'readonly' => 1, 'value_name' => '', 'value' => 'login', 'name' => 'cmd', 'id' => 'cmd', 'type' => 'hidden', 'size' => '20' }, 'HTML::Form::TextInput' ) ] }, 'HTML::Form' );
#!/usr/bin/perl -w use strict; use WWW::Mechanize; use Data::Dumper; use LWP; my ($user,$pass) = ("$ARGV[0]","$ARGV[1]"); $user = chomp($user);$pass = chomp($pass); my $mech = WWW::Mechanize->new(); $mech -> cookie_jar(HTTP::Cookies->new()); $mech -> get('http://*_edit_*/Login.jsp'); $mech -> submit_form( form_id => 'fLogin', fields => { txtUserID => $user, txtPassword => $pass, } ); my $html_raw = $mech -> content(); print "\n$html_raw\n";
In reply to WWW::Mechanize form submit w/ password failing [SOLVED] by ogmogul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |