Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Question about WWW::Mechanize::Firefox

by Anonymous Monk
on Nov 12, 2012 at 11:06 UTC ( #1003416=note: print w/ replies, xml ) Need Help??


in reply to Question about WWW::Mechanize::Firefox

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.

Well, there is more than one INPUT TYPE=Button with a value of ">>"

A better idea would be to match against onClick attribute

or complain to whomever programmed that page to add ID's or name's to each button, they have a contact form

or use some bioperl module to access that page, because data appears available for download and http://www.bioperl.org/wiki/Gbrowse says it uses Gbrowse, surely there must be an interface for scraping Gbrowse already :)


Comment on Re: Question about WWW::Mechanize::Firefox
Replies are listed 'Best First'.
Re^2: Question about WWW::Mechanize::Firefox
by ssj262 (Initiate) on Nov 12, 2012 at 11:30 UTC

    Thank you for your reply. I checked and first part of the code is working. The problem is with the code below.

    $moz->select($variation,$varvalue); $moz->select($func_class,$funcvalue); $moz->set_fields( geneSymname => 'chrnb2' ); $moz->select($output,$outformat); $moz->submit( $form_name1 );

    For the first part I can see strains being added to the box. But for multiple select, I don't see any action happening on the webpage.

      What does that mean?

        There two "<select multiple" code blocks in the page, and the code above is for them. The code in the page source for those blocks is below: (In this one, I want to select SNP)

        <SELECT MULTIPLE="multiple" NAME="polymorphismType" SIZE="5"> <OPTION value="" selected="selected">ANY</OPTION> <OPTION VALUE='1878510'>SNP</OPTION> <OPTION VALUE='1878511'>IN-DEL</OPTION> <OPTION VALUE='1878512'>Named</OPTION> <OPTION VALUE='1878513'>Mixed</OPTION> <OPTION VALUE='1878514'>MNP</OPTION> </SELECT>

        And in the next one, I want to select "coding-non synonymous"

        <SELECT MULTIPLE="multiple" SIZE="5" NAME="functionClass"> <OPTION value="" selected="selected">ANY</OPTION> <OPTION VALUE='1878486'>Coding-NonSynonymous</OPTION> <OPTION VALUE='1878487'>Coding-Synonymous</OPTION> <OPTION VALUE='1878489'>Intron</OPTION> <OPTION VALUE='1878490'>Locus-Region</OPTION> <OPTION VALUE='1878493'>mRNA-UTR</OPTION> <OPTION VALUE='1878494'>Splice-Site</OPTION> </SELECT>

        So the code for the making the selections is written below, but I don't know if it is right or not

        $variation='polymorphismType'; $varvalue=("1878510"); $func_class='functionClass'; $funcvalue='1878486'; $moz->select($variation,$varvalue); $moz->select($func_class,$funcvalue);

        THANK YOU FOR YOUR PATIENCE.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (17)
As of 2015-07-28 17:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls