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 ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-24 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found