Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: parsing html link

by poolpi (Hermit)
on May 25, 2009 at 10:24 UTC ( #766002=note: print w/ replies, xml ) Need Help??


in reply to parsing html link

You might try something like that:

#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $start = "http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/GetPage.pl +?pdbcode=2j6p&template=ligands.html&l=1.1"; my $m = WWW::Mechanize->new( autocheck => 1 ); $m->get($start); my @links = $m->find_all_links(); print "No link\n" unless @links; for my $link (@links) { next unless $link->text; if ( $link->text =~ /EPE/msx ) { print $link->text, "\n"; } } # Output: # EPE 1148(C) # EPE 1148(D) # EPE-EPE


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb


Comment on Re: parsing html link
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2015-07-29 10:03 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 (263 votes), past polls