#!/usr/bin/perl --
use strict;
use warnings;
use HTML::TreeBuilder::XPath;
my $tree = HTML::TreeBuilder::XPath->new;
$tree->parse_content(<<'__HTML__');
__HTML__
for my $result ($tree->findnodes(q{/html/body/div})) {
print "$result ", $result->detach(),"\n
\n";
print $result->findvalue(q{//div[@class="here"]});
print "\n
\n\n";
}
__END__
HTML::Element=HASH(0x1b7897c) HTML::Element=HASH(0x1b787e4)
this's the value
HTML::Element=HASH(0x1b78a48) HTML::Element=HASH(0x1b787e4)
this's the value
HTML::Element=HASH(0x1b78afc) HTML::Element=HASH(0x1b787e4)
this's the value
HTML::Element=HASH(0x1b78bb0) HTML::Element=HASH(0x1b787e4)
this's the value
HTML::Element=HASH(0x1b78c64) HTML::Element=HASH(0x1b787e4)
this's the value
HTML::Element=HASH(0x1b78d18) HTML::Element=HASH(0x1b787e4)
this's the value