Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: HTML::TreeBuilder::XPath not loading the complete $page

by tangent (Deacon)
on Mar 19, 2013 at 21:00 UTC ( #1024387=note: print w/ replies, xml ) Need Help??


in reply to Re^2: HTML::TreeBuilder::XPath not loading the complete $page
in thread HTML::TreeBuilder::XPath not loading the complete $page

Are you sure there isn't something else going on? When I use your sample content it still works:

my $content = q| <html> <head> </head> <body> <DIV>Div number 12</DIV> <HTML> <HEAD> </HEAD> <BODY> <p>You have an error blah blah blah</p> </BODY> </HTML> <DIV>Div number 13</DIV> </body> </html> |; my $tree = HTML::TreeBuilder::XPath->new; $tree->parse_content( $content ); my @divs = $tree->findnodes( '/html/body/div' ); for my $div (@divs) { print $div->as_HTML . "\n"; }
Output:
<div>Div number 12</div> <div>Div number 13</div>


Comment on Re^3: HTML::TreeBuilder::XPath not loading the complete $page
Select or Download Code
Re^4: HTML::TreeBuilder::XPath not loading the complete $page
by Lord Gartlar (Initiate) on Mar 19, 2013 at 21:26 UTC

    There are some errors displayed there inside the new HTML...

    As mentioned, I tried deleting them with a mere while and it finally worked...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2014-09-24 03:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls