http://www.perlmonks.org?node_id=1003406

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

I am a student in biology and have recently started learning perl programming. I have been trying to write a code for my project wherein i need to go to a website search for sequences related to mouse strains and save the data on resulting page in a text file.Earlier i was trying to use Mechanize but then after reading I realized it is not good with javascripts. So i am using WWW::Mechanize::Firefox.

I have added the MozRepl and Firebug addon to firefox. The code seems to run but there is no output at the terminal. I am running it on Ubuntu. I have written the code below. Kindly have a look.

#/usr/bin/perl -w use WWW::Mechanize::Firefox; my $moz = WWW::Mechanize::Firefox->new(); $moz->get($url); $url='http://www.informatics.jax.org/javawi2/servlet/WIFetch?page=snpQ +F'; $form_name1='queryForm'; $strain='availableStrains'; @strvalues=("15","38048","71","25292"); $variation='polymorphismType'; $varvalue='1878510'; $func_class='functionClass'; $funcvalue='1878486'; $output='format'; $outformat='tab'; $moz->get( $url ); $moz->form_name( $form_name1 ); $moz->select($strain,\@strvalues); sleep 1; $moz->click({ xpath => '//*[@value=">>"]' }); $moz->select($variation,$varvalue); $moz->select($func_class,$funcvalue); $moz->set_fields( geneSymname => 'chrnb2' ); $moz->select($output,$outformat); sleep 1; $moz->click_button( value => 'Search' ); ($url2) = $mech -> uri; $content=get($url2); print $content,"\n"; exit;

I have a strong feeling that there is some problem with following part.

$moz->click({ xpath => '//*[@value=">>"]' });

The page source for the above button is:

<INPUT VALUE="&gt;&gt;" onClick="setReference(queryForm.availableStrains, queryForm.referenceStrain);" TYPE="button">

This is my first time on perlmonks and pardon me for such a long question. I am looking forward to replies from fellow monks.