我在 perl 中有一个小脚本。在脚本中有一个“表格”。下面是表格的样子:
sub print_form {
my ($tt, $idnum) = @_;
print "<CENTER>\n";
print "<FORM METHOD='POST' ACTION='/cgi/thisscript.pl'>\n";
print " <INPUT type='hidden' name='idnum' value='$idnum' />\n";
print " <INPUT type='hidden' name='rain' value='$ttprefix' />\n";
print " <LABEL FOR='pin'>label 1</LABEL>\n";
print " <SELECT name='pin'>\n";
my $profiles = $tt->get_profile_urls;
for my $pin (keys %$profiles){
print " <OPTION value='$pin'>$profiles->{$pin}{name} ($pin)</OPTION>\n";
}
print " </SELECT>\n";
print " <BR />\n";
print " <LABEL FOR='invid'>Select the qouta</LABEL>\n";
print " <SELECT name='invid'>\n";
my $qouta = $tt->get_qouta;
for my $invid (sort { $a <=> $b } keys %$qouta){
my ($name, $pren) = ($qouta->{$invid}{name}, $qouta->{$invid}{pren});
print " <OPTION value='$invid'>$name ($pren)</OPTION>\n";
}
print " </SELECT>\n";
print " <BR />\n";
print " <LABEL FOR='qty'>qouta quantity</LABEL>\n";
print " <INPUT type='text' name='qty' value='$atom' />\n";
print " <BR />\n";
print " <INPUT type='submit' value='submit'/>\n";
print "</FORM>\n";
print "</CENTER>\n";
}
我试图循环它,例如一个javascript函数(在同一页面上)会自动点击“提交”按钮#次。
是否可以让javascript“自动”点击提交功能?我知道这在带有油脂猴子的用户脚本中是可能的,尽管我希望能够在网页上完成这一切。