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

Re: Re: LWP and TokeParser

by silent11 (Vicar)
on Jan 11, 2002 at 02:40 UTC ( [id://137852]=note: print w/replies, xml ) Need Help??


in reply to Re: LWP and TokeParser
in thread LWP and TokeParser

Sorry, it should be :
use HTML::TokeParser; use LWP::Simple; my $stuff = get('http://some_url.com); my $file = HTML::TokeParser->new("$stuff"); while ( my $token = $file->get_tag("a")) { my $url = $token->[1]{href} || "-"; my $text = $file->get_trimmed_text("/a"); print "<a href=$url>$text</a><br>"; }

And why can't I edit my original post as I usually can ??
oh well, thanks in advance!

Replies are listed 'Best First'.
Re: Re: Re: LWP and TokeParser
by kwoff (Friar) on Jan 11, 2002 at 03:04 UTC
    Re-read `perldoc HTML::TokeParser`. you want HTML::TokeParser->new(\$stuff).
      Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (1)
As of 2024-04-25 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found