1
2
3
4
5
HTML bla bla <tags> dies und jenes..
<a href="/user/MICHAEL" class="nick">MICHAEL</a>
<a href="/user/Wolfgang" class="nick">Wolfgang</a>
<a href="/user/daniel" class="nick">daniel</a>
....
1 2 3 4 5 6 7 8 9 10
use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new; my $html = <<"EOM"; HTML bla bla <tags> dies und jenes.. <a href="/user/MICHAEL" class="nick">MICHAEL</a> <a href="/user/Wolfgang" class="nick">Wolfgang</a> <a href="/user/daniel" class="nick">daniel</a> EOM $tree->parse($html); my @nodes = $tree->findvalues("//a"); # MICHAEL Wolfgang daniel
1
2
Can't locate object method "findvalues" via package "XML::XPathEngine" at C:/str
awberry/perl/lib/HTML/TreeBuilder/XPath.pm line 117.
my @nicks = $tree->findvalues('//a[@class="nick"]');