Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I physically have to click 'next' 6 times, and then I click 'submit'. There are 6 pages in the form I have to traverse before I have the option to submit the form. I'm using the follwoing code:The portion I'm working with: <form action='http://TestMachine/SomeForm.asp'method="post" id="MetaFo +rm" name="MetaForm" Enctype="multipart/form-data" target="hidMFLIFram +e"> <div class="FormContent"> <div id="FormHeader"></div> <div id="TabsSection" onclick="SelectTab()" class="TabRow"></d +iv> <div id="FormPage" class="FormSection"></div> <div id="PreviewSection"></div> <div id="EndSection"></div> <div id="buttonTable"><p><table align="center" cellspacing="15 +"> <tr> <DIV ID="uploadanim" STYLE="position: relative; visibi +lity: hidden;"><IMG src='http://TestMachine/Images/Upload.gif></DIV> <td><input id="btnPreviousTab" name="btnPreviousTab" o +nclick="PreviousTab()" type="button" value="Previous" disabled="true" +/></td> <td><input id="btnNextTab" name="btnNextTab" onclick=" +NextTab()" value="Next" type="button" /></td> <td><input id="btnPreview" name="btnPreview" onclick=" +ShowPreview()" type="button" value="Preview" disabled="true" /></td> <td><input id="btnSubmit" name="btnSubmit" type="butto +n" value="Submit" disabled="true" onclick="return submitMetaForm()"/> +</td> + <td><input id="btnCalculate" name="btnCalculate" type= +"button" onclick="Calculate()" value="Calculate" /></td> + </tr></table> </p></div> </div> <input type="hidden" id="guid" name="guid"/> <input type="hidden" id="pagename" name="pagename"/> <input type="hidden" id="hidmfltempfolder" name="hidmfltempfol +der"/> </form>
This just seems to cycle and never actually advance. Am I doing something wrong, and or is there a way I can check the results instead of printing out the page's content? Thank you againuse LWP::UserAgent; $ua = LWP::UserAgent->new; for (1 .. 6 ) { my $req = HTTP::Request->new(POST => 'http://TestMachine/SomeForm.asp +'); $req->content_type('application/x-www-form-urlencoded'); $req->content('onclick="NextTab()"'); } my $req = HTTP::Request->new(POST => 'http://TestMachine/SomeForm.asp +'); $req->content_type('application/x-www-form-urlencoded'); $req->content('onclick="return submitMetaForm()"'); my $res = $ua->request($req); print $res->as_string;
|
|---|