|
I really love the functionality behind this package. This is what I have been looking for.
The problem that I am having is that anytime I try to access an object any deeper than /html/body it doesn't work.
The following code always prints "Doesn't exist":
use HTML::TreeBuilder::XPath;
my $tree= HTML::TreeBuilder::XPath->new;
$tree->parse_file( "http://moneycentral.msn.com/investor/invsub/results/compare.asp?Page=TenYearSum
+mary&Symbol=WHT");
$xpath = '/html/body/div[@id="wrapper"]';
if ($tree->exists($xpath)) {
print "$xpath: Exists!\n";
} else {
print "$xpath: Doesn't exist!\n";
}
If you could tell me what I am doing wrong it would be greatly appreciated.
Thanks.
-Joel
|