Hi Monks, I am trying to submit a webform using WWW::Mechanize. With the following code, only username field is getting filled. I am not sure why password field is not getting populated with value and thereby unable to submit the form. Any thoughts on this please ...
#!/usr/bin/perl use strict; use WWW::Mechanize; my $username = 'admin'; my $password = 'secret'; my $url = 'https://admin.testdomain.com'; my $mech = WWW::Mechanize->new; $mech->get($url); $mech->set_fields( 'ctl00$cntPlaceHolder$UsernameTextBox' => $username, 'ctl00$cntPlaceHolder$PasswordTextBox' => $password ); $mech->submit_form(); my $page = $mech->content(); print $page;
HTML Code after clicking view source
<td width="99%"> <input name="ctl00$cntPlaceHolder$UsernameTextBox"type="text" valu +e="admin" maxlength="60" id="ctl00_cntPlaceHolder_UsernameTextBox" cl +ass="textField" /><span class="MandatoryText">*</span> </td> <td width="99%"> <input name="ctl00$cntPlaceHolder$PasswordTextBox" type="password" + id="ctl00_cntPlaceHolder_PasswordTextBox" class="textField" /><span +class="MandatoryText">*</span> </td>
In reply to WWW::Mechanize - Unable to fill password field by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |