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