in reply to Re^3: problem parsing html
in thread problem parsing html
I used your code and add the function split
#!/usr/local/bin/perl use strict; use warnings; use LWP::Simple; use HTML::TreeBuilder::XPath; use Data::Dumper; my $url="http://www.ebi.ac.uk/thornton-srv/databases/cgi-bin/pdbsum/Ge +tPage.pl?pdbcode=1r9t&template=main.html"; my $p = HTML::TreeBuilder::XPath->new_from_content(get($url)); my @chain_tags = $p->findnodes("//td//a[contains(\@href,'chain=')]"); my @chains = map { $_->attr('href') =~ /chain=(\w)/ } @chain_tags; my @chain = map {split ' '} @chains; foreach my $chain (@chain){print "$chain\n";}
the output was:
so I think I can iterate my analysis for every chain....using as array with foreach....Thanks.... :-)pisolo@pisolo:~/Scrivania/test$ perl test7.pl A A B C E F H I J K L
|
|---|