HTML-TreeBuilder-XPath - Re: I'm having a little problem

Posted on Thu Jul 19 21:10:18 2007 by yeddish in response to 5752 (See the whole thread of 6)
Re: I'm having a little problem
I have modified my code to include the changes that you mentioned but I still seem to get the same result. I just can't seem to figure out where my problem lies. Here's my new code:

use LWP::Simple; use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new; $html = get("http://moneycentral.msn.com/investor/invsub/results/compare.asp?Page=TenYearSummary&Sy +mbol=WHT"); $tree->parse_file($html); $xpath = '/html/body/div[@id="wrapper"]'; print "$html\n"; #This prints the HTML just fine if ($tree->exists($xpath)) { print "$xpath: Exists!\n"; } else { print "$xpath: Doesn't exist!\n"; }

Thanks.
-Joel
Direct Responses: 5771 | Write a response