我需要访问网址并使用perl在页面中设置不同的参数。
页面中有许多下拉菜单需要设置。
如何设置每个菜单。
我写的代码是..
use strict;
use warnings;
use strict;
use WWW::Mechanize;
use HTTP::Cookies;
my $outfile = "out2.htm";
my $url = "www.abcd.com"; #my web page
my $mech = WWW::Mechanize->new();
$mech->cookie_jar(HTTP::Cookies->new());
$mech->get($url);
my $data = $mech->content();
open (f,'>',"data1.htm");
print f $data;
close(f);
$mech->form_name('form name');
my $network = "Network";
my $net_name = "Airtel";
$mech->select($network,$net_name);
my $output_page = $mech->content();
open (g,'>',"data2.htm");
print g $output_page;
close(g);
我无法在输出的html文件data2.htm中看到该选项为“选定选项”
我对perl完全不熟悉。请帮忙