Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: HTML::TokeParser - extract values between tags

by Anonymous Monk
on Feb 17, 2014 at 12:06 UTC ( #1075163=note: print w/replies, xml ) Need Help??


in reply to HTML::TokeParser - extract values between tags

you're using interpolating heredocs :) double-quoted here docs :) strict vars or warnings would have warned you
#!/usr/bin/perl -- use strict; use warnings; use XML::LibXML 1.70; ## for load_html/load_xml/location use Data::Dump qw/ dd /; my %shabs; my $dom = XML::LibXML->new( qw/ recover 2 / )->load_html( string => $c +ontent ); for my $h5 ( $dom->findnodes( q{ //h5 } ) ){ print $h5->nodePath, "\n"; my $key = $h5->textContent; my $next = $h5->nextSibling; while( $next ){ print $next->nodePath, "\n"; $shabs{$key} .= $next->textContent; $next = $next->nextSibling; last if eval { $next->tagName eq 'h5' } ; } print "\n"; } dd( \%shabs );

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2022-01-28 19:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (73 votes). Check out past polls.

    Notices?