thekestrel has asked for the wisdom of the Perl Monks concerning the following question:
<html> <body> <script language="JavaScript"> function fun() { document.form1.submit() } </script> <form name='form1' action="http://www.msn.com"> <input type=hidden name="Fruit" value="apple"> <input type=hidden name="Animal" value="dog"> <input type=hidden name="language" value="perl"> </form> <a href="javascript:fun()">A link</a> </body> </html>
use Win32::IE::Mechanize; use Win32::IE::Input; use warnings; use strict; #location of the html with the form my $url = "http://location.of.test.file/test.html"; my $ie = Win32::IE::Mechanize->new(visible => 1); #get the page $ie->get($url); #select the form my $form = $ie->form_name('form1'); #This is the bit I'm stuck on... #Its going to need a name, type and value my $new1 = Win32::IE::Input->new(); print "NEW : $new1 " . $new1->name . "\n"; #This should print out the existing list of inputs PLUS the one I just + added my @inputs = $form->inputs(); my $c = 1; foreach my $i ( @inputs ) { print "Input$c : " . $i->name . " : " . $i->value . " : " . $i +->type . "\n"; $c++; } #find the link and follow ...this works fine my $link = $ie->find_link( url_regex => qr/fun/i ); my $ll = $link->url; $ie->get($ll);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Win32::IE::Input
by ikegami (Patriarch) on Jul 13, 2005 at 23:12 UTC | |
by thekestrel (Friar) on Jul 14, 2005 at 22:26 UTC |