Javascript Perl基于元素ID填写表单
我正在尝试使用Javascript Perl基于元素ID填写表单,javascript,perl,mechanize,www-mechanize-firefox,Javascript,Perl,Mechanize,Www Mechanize Firefox,我正在尝试使用WWW::Mechanize填写表格。不幸的是,我的页面需要JS,所以我现在使用的是WWW::Mechanize::Firefox 这是我要填写的内容 <input id="ember745" class="ssTextboxField"></input> 弄明白了,必须使用选择器 my $field = $mech->selector('input.ssTextboxField', single => 1); $mech->field(
WWW::Mechanize
填写表格。不幸的是,我的页面需要JS,所以我现在使用的是WWW::Mechanize::Firefox
这是我要填写的内容
<input id="ember745" class="ssTextboxField"></input>
弄明白了,必须使用选择器
my $field = $mech->selector('input.ssTextboxField', single => 1);
$mech->field( $field => $value );
我现在无法进行测试,但您可以在该方法中使用简单的CSS选择器,例如,
$mech->field('ember745',$value)
我认为您无法使用设置字段
,它由提交表单
调用。
my $field = $mech->selector('input.ssTextboxField', single => 1);
$mech->field( $field => $value );