rashichauhan has asked for the wisdom of the Perl Monks concerning the following question:

Dear all..I have to connect a html page http://metexplore.toulouse.inra.fr/metexplore/index.php/2011-06-06-14-41-10/choke-point-reactions Now this is page is having drop down box whose name is "org" and i have to select Acinetobacter baumanniifrom from this drop down list .how to do that?I have written a code but it is not working.
use strict; use WWW::Mechanize; use HTTP::Cookies; my $outfile = "out1.htm"; my $url = "http://metexplore.toulouse.inra.fr/metexplore/index.php/201 +1-06-06-14-41- 10/choke-point-reactions"; my $name = "org"; #my $value="Bacillus anthracis(Strain:Ames Ancestor)MicroCyc"; my $value="1"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_name('form'); $mech->select($name, $value); #$mech->select("select", $select); #$mech->select("$select", 1); $mech->click(); #$mech->follow_link(text => "click here", n => 1); my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE);
plz help me!!

Replies are listed 'Best First'.
Re: question regarding perl mechanize module
by mtmcc (Hermit) on Jul 27, 2013 at 08:25 UTC
    Have you tried this?

    As an aside, it's worth adding use warnings as a general rule...

    I hope that helps.

Re: question regarding perl mechanize module
by Anonymous Monk on Jul 27, 2013 at 08:35 UTC

    I have written a code but it is not working.

    Did you really write that code? In what way is it not working? Where do things go wrong?

      $agent->field("cboProject", $project); I have check this page.. but i do not know..what is "cboproject" and $project. I have a dropdownbox whose name is "org" and i have to select a value "bacillus anthracis " from it". how to proceed?Plz help me!!