#!/usr/bin/perl -w
use WWW::Mechanize
$adres = qq{http://debian.ds/};
$mech = WWW::Mechanize->new();
$mech->get( $adres );
$mech->click( 'agreed' );
print $mech->content;
#
我得到:在 /usr/local/share/perl/5.14.2/WWW/Mechanize.pm 第 1707 行同意的名称没有可点击的输入。
html看起来像这样:
<fieldset class="submit-buttons">
<input type="submit" name="agreed" id="agreed" value="text1" class="button1" />
<input type="submit" name="not_agreed" value="text2" class="button2" />
<input type="hidden" name="change_lang" value="" />
<input type="hidden" name="creation_time" value="1373067606" />
<input type="hidden" name="form_token" value="83ab2ec47bc4ee37f" />
</fieldset>