Lord Gartlar has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am trying to parse some URL with HTML TreeBuilder XPATH.
I retrieve an URL using LWP UserAgent which is loaded to $response->content.
Here's the code that loads that variable to a $tree instance:
my $tree = HTML::TreeBuilder::XPath->new; $tree->parse($response->content); my $t = $tree->findnodes(qq{/html/body/form/div}); print $t->size;
If I print the content of $response->content to a plain html file and open it using Firefox, the total amount of /html/body/form/div's is 19.
However, printing $t->size results in only 12..
Why is this happening??
$tree is ignoring most of my divs and so I can't retrieve data from them....
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::TreeBuilder::XPath not loading the complete $page
by Corion (Patriarch) on Mar 19, 2013 at 19:58 UTC | |
|
Re: HTML::TreeBuilder::XPath not loading the complete $page
by tangent (Parson) on Mar 19, 2013 at 19:46 UTC | |
by Lord Gartlar (Initiate) on Mar 19, 2013 at 20:11 UTC | |
by tangent (Parson) on Mar 19, 2013 at 21:00 UTC | |
by Lord Gartlar (Initiate) on Mar 19, 2013 at 21:26 UTC | |
by Anonymous Monk on Mar 20, 2013 at 06:56 UTC |