Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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.


In reply to Question about WWW::Mechanize::Firefox by ssj262

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (10)
    As of 2014-10-02 13:56 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      What is your favourite meta-syntactic variable name?














      Results (61 votes), past polls