I'm a perl beginner and am learning to use the www::mechanize module to get a list of genome sequencing projects from http://www.ncbi.nlm.nih.gov/Traces/wgs/. After I fill in the form, I cannot figure out how to select 'All' from the 'Show projects on page' listbox.
I tried 'find_all_inputs' with 'select' as criteria for a listbox, but nothing gets assigned to the variable. My other issue is not being able to click on the 'Download as TAB delimited list' link to output results to file.
I can complete this task using the browser, but then I don't learn. Below are the few lines of code I have so far. Your advice will be a great help.
use autodie qw/ open close /;
# create WWW::Mechanize object
# autocheck 1 checks each request to ensure it was successful
my $browser = WWW::Mechanize->new( autocheck =>  );
# retrieve page
$browser->get( 'http://www.ncbi.nlm.nih.gov/Traces/wgs/' );
#select form to fill based on mech-dump output
# fill field 'term' with name of species
$browser->field( 'term', 'Escherichia' );
# click apply button
$browser->submit( 'Apply' );
my $url = $browser->uri;
# launch browser to test url
#system( 'firefox', $url );
my @inputs = $browser->find_all_inputs(
type => 'select'
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:
Outside of code tags, you may need to use entities for some characters:
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||