doubledecker has asked for the wisdom of the Perl Monks concerning the following question:
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WWW::Mechanize - Unable to fill password field
by 7stud (Deacon) on Jan 03, 2015 at 23:15 UTC | |
by doubledecker (Scribe) on Jan 05, 2015 at 07:39 UTC | |
by Anonymous Monk on Jan 05, 2015 at 08:17 UTC | |
|
Re: WWW::Mechanize - Unable to fill password field
by Anonymous Monk on Jan 03, 2015 at 20:02 UTC |