Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: HTML::TokeParser not giving any tokens.

by karlgoethebier (Abbot)
on Dec 01, 2014 at 13:06 UTC ( #1108826=note: print w/replies, xml ) Need Help??

in reply to HTML::TokeParser not giving any tokens.

Try this:

if ( $response->is_success ) { my $tp = HTML::TokeParser->new( \$response->decoded_content ) || die "Can't open: $!"; while ( my $token = $tp->get_tag('img') ) { print $token->[1]->{'src'}, qq{\n}; } } else { print $response->decoded_content; die $response->status_line; } __END__ Starting...<br /><br /><br />Success! +ojs.php?id=39770&type=5 ../images/logo14.png ../images/ag.gif

Update: Added output. NB.: Saw solution above too late :-(

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: HTML::TokeParser not giving any tokens.
by rbhyland (Acolyte) on Dec 01, 2014 at 13:47 UTC

    Thanks! I'm using your solution. There's no substitute for understanding. I see now what I did wrong, which is the most important thing.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (None)
    As of 2021-10-18 01:56 GMT
    Find Nodes?
      Voting Booth?
      My first memorable Perl project was:

      Results (72 votes). Check out past polls.