Created
October 25, 2009 11:30
-
-
Save EragonJ/218013 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use WWW::Mechanize; | |
my $file = "test.txt"; | |
my $ofile = ">output.txt"; | |
my $checkURL = "http://www.ebi.ac.uk/pdbsum/"; | |
open FILE, $file or die "File open error!!"; | |
open FILE2, $ofile or die "File open error!!"; | |
my $mech = WWW::Mechanize -> new(); | |
my $result; | |
while(<FILE>){ | |
chomp; | |
$mech -> get($checkURL); | |
$mech -> submit_form( | |
form_number => 1, | |
fields => { | |
template => "main.html", | |
EBI => "TRUE", | |
pdbcode => $_, | |
}, | |
); | |
print FILE2 "$_ , $1\n" if ($mech -> content) =~ /Name:.*<font color=darkred>(.*?)<\/font><\/b><BR><\/TD>/s; | |
} | |
close FILE; | |
close FILE2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment