#!perl use strict; use HTML::TreeBuilder::XPath; use Data::Dumper; my $tree = HTML::TreeBuilder::XPath->new(); $tree->store_comments(1); my $html = do { local $/; };; $tree->parse( $html ); my @nodes = $tree->findnodes( qw( //tr[@class='Odd'] ) ); for my $subtree ( @nodes ) { my($value) = $subtree-> findnodes( qw( td[1]/script ) ); my $script = join "", $value->content_list; my $other_data = $subtree->findvalue( qw( td[2] ) ); printf "Value: %s\n", $script; printf "Other Data: %s\n", $other_data; } __DATA__
Other Data
Other Data
Other Data
Other Data
Other Data
Other Data
Other Data
#### Value: Decode("%31%31%39%2e%32%35%33%2e%36%31%2e%31%32%31") Other Data: Other Data Value: Decode("%32%32%32%2e%36%32%2e%32%30%37%2e%37%30") Other Data: Other Data Value: Decode("%35%38%2e%32%30%2e%32%32%38%2e%32%32") Other Data: Other Data Value: Decode("%32%32%33%2e%38%37%2e%31%39%2e%35") Other Data: Other Data