使用perl mechanize进行多种形式的选择

时间:2013-08-07 07:53:24

标签: forms perl firefox mechanize

我在使用perl处理表单时遇到了一些疑问。

我正在使用perl mechanize Firefox模块。我用来处理表单的代码。

$mech->form_name("CFForm_1");
my $form = $mech -> current_form;
$mech->select( 'state', '$state' );
$mech->select( 'country', '$country' ); # Selection box for state
$mech->click_button(value=>"Search");  #Selection box for country

对于这样的表格,我使用2 while循环来选择每个州和国家。

enter image description here

我想知道是否有其他方法。用于选择选项(州和国家) 逐一。需要一些建议。

提前致谢。

0 个答案:

没有答案