Skip to content

Instantly share code, notes, and snippets.

@EragonJ
Created October 25, 2009 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EragonJ/218013 to your computer and use it in GitHub Desktop.
Save EragonJ/218013 to your computer and use it in GitHub Desktop.
#!/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