Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Any pure-perl html to text? (Or: missing a perl equivalent to 'lynx -dump')

by davidrw (Prior)
on Oct 15, 2006 at 16:22 UTC ( [id://578399]=note: print w/replies, xml ) Need Help??


in reply to Any pure-perl html to text? (Or: missing a perl equivalent to 'lynx -dump')

WWW::Mechanize has a method for that (it requires that HTML::TreeBuilder is installed as well) ..
my $mech = WWW::Mechanize->new(); $mech->get('http://example.com'); print $mech->content(format => 'text');
If you're not already using WWW::Mechanize for your scraping, i highly recommend it (note it uses LWP underneath)..
Update: added 'print' so that snippet has output

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found