0
我希望从网站http://revigo.irb.hr/下载具有交互式菜单的信息。使用使用perl填充表单WWW :: Mechanize :: Formfiller
perl -MWWW::Mechanize::Shell -e shell
get http://revigo.irb.hr/
fillout
...
submit
script
最终的代码如下获取表单域后我想下面的Perl代码:
use strict;
use WWW::Mechanize;
use WWW::Mechanize::FormFiller;
use URI::URL;
my @go_terms=qw/GO:0006612 GO:0045862 GO:0048545 GO:0007568 GO:0046326 GO:0051901 GO:0010524 GO:0006044 GO:0032024/;
my $go_string=join("\n",@go_terms);
my $agent = WWW::Mechanize->new(autocheck => 1);
my $formfiller = WWW::Mechanize::FormFiller->new();
$agent->env_proxy();
$agent->get('http://revigo.irb.hr/');
$agent->form_number(1) if $agent->forms and scalar @{$agent->forms};
$formfiller->add_filler('goList' => Fixed => $go_string);
$formfiller->add_filler('cutoff' => Fixed => '0.4');
$formfiller->add_filler('isPValue' => Fixed => 'yes');
$formfiller->add_filler('whatIsBetter' => Fixed => 'higher');
$formfiller->add_filler('goSizes' => Fixed => '0');
$formfiller->add_filler('measure' => Fixed => 'SIMREL');
$formfiller->fill_form($agent->current_form);
my $request = $agent->click("startRevigo");
print $request->as_string;
但是我得到了以下错误消息“发布信息时出错http://revigo.irb.hr/revigo.jsp :内部服务器错误在revigo.mechanize.pm行21“ 任何人都可以帮助我解决问题? 在此先感谢
哪条线是21号线? – simbabque
原来第21行包含我的$ request = $ agent-> click(“startRevigo”); 谢谢,现在问题已解决。 – WoA