WoA
WoA

Reputation: 173

Filling up form using perl WWW::Mechanize::Formfiller

I wish to download information from the website http://revigo.irb.hr/ which have an interactive menu. I'm trying the following Perl code after fetching out the form fields using

perl -MWWW::Mechanize::Shell -e shell
get http://revigo.irb.hr/
fillout
...
submit
script

The final code is as follows:

      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;

However I'm getting the following error message "Error POSTing http://revigo.irb.hr/revigo.jsp: Internal Server Error at revigo.mechanize.pm line 21" Can anybody help me to solve the problem? Thanks in advance

Upvotes: 0

Views: 1530

Answers (1)

daxim
daxim

Reputation: 39158

goSizes must have a valid value, such as 0. You could have easily found this out yourself by using Firebug.

Upvotes: 2

Related Questions