The snippet of the HTML structure in the related website can be found here :use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $tf_add = "http://rulai.cshl.edu/cgi-bin/SCPD/getgene2?ARG1"; $mech->get($tf_add); $mech->set_fields( 'start' => -450, 'end' => 50 ); # this part works # but not this: $mech->click_button( name => "action", value => "Retrieve sequence" ); $mech->submit(); my $result = $mech->content(); print "$result\n";
And the desired final output looks like this (by hand clicking).<html><title>ARG1</title> <body bgcolor=white> <h2 align=center>ARG1</h2><hr> <form method="post" action="/cgi-bin/SCPD/getgene2?ARG1" enctype="appl +ication/x-www-form-urlencoded"> <input type="submit" name="action" value="Get mapped sites" /><input t +ype="submit" name="action" value="Get putative sites" /><input type=" +submit" name="action" value="Get intergenic region" /><br /><input ty +pe="submit" name="action" value="Retrieve sequence" />Start<-ATG <inp +ut type="text" name="start" value="-500" size="5" maxlength="5" />ATG +->End <input type="text" name="end" value="50" size="5" maxlength="5" + /><div></div></form><hr> <pre> ORF YOL058W GENE ARG1 XX FACTOR <a href= "getfactor?ARC">ARC</a> COORDINATE (-269, -247) SEQUENCE CATTTAAAGGCAGGAGAGAGAGA REFERENCE Yeast 1995, 11:1367-1380 .... skip some entries... </pre>
Finally I would just like to extract the DNA sequence after <pre> tag above, starting from ">".<html><title>ARG1</title> <body bgcolor=white> <h2 align=center>ARG1</h2><hr> <form method="post" action="/cgi-bin/SCPD/getgene2?ARG1" enctype="appl +ication/x-www-form-urlencoded"> <input type="submit" name="action" value="Get mapped sites" /><input t +ype="submit" name="action" value="Get putative sites" /><input type=" +submit" name="action" value="Get intergenic region" /><br /><input ty +pe="submit" name="action" value="Retrieve sequence" />Start<-ATG <inp +ut type="text" name="start" value="-450" size="5" maxlength="5" />ATG +->End <input type="text" name="end" value="50" size="5" maxlength="5" + /><div></div></form><hr> <pre> >YOL058W ARG1 218759 219259 CGAGCTTTTTCACTGCAGTAATTCTCCACATGGGCCCAGCCACTGAGATA AGAGCGCTATGTTAGTCACTACTGACGGCTCTCCAGTCATTTATGTGATT TTTTAGTGACTCATGTCGCATTTGGCCCGTTTTTTTCCGCTGTCGCAACC TATTTCCATTAACGGTGCCGTATGGAAGAGTCATTTAAAGGCAGGAGAGA GAGATTACTCATCTTCATTGGATCAGATTGATGACTGCGTACGGCAGATA GTGTAATCTGAGCAGTTGCGAGACCCAGACTGGCACTGTCTCAATAGTAT ATTAATGGGCATACATTCGTACTCCCTTGTTCTTGCCCACAGTTCTCTCT CTCTTTACTTCTTGTATCTTGTCTCCCCATTGTGCAGCGATAAGGAACAT TGTTCTAATATACACGGATACAAAAGAAATACACATAATTGCATAAAATA ATGTCTAAGGGAAAAGTTTGTTTGGCTTATTCTGGTGGTTTAGATACCTC
In reply to Click button not working in WWW::Mechanize by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |