in reply to Re^2: HTML::TreeBuilder::XPath not loading the complete $page
in thread HTML::TreeBuilder::XPath not loading the complete $page
Output: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"; }
<div>Div number 12</div> <div>Div number 13</div>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: HTML::TreeBuilder::XPath not loading the complete $page
by Lord Gartlar (Initiate) on Mar 19, 2013 at 21:26 UTC |