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

Re: How can I download HTML and save it as txt?

by jdporter (Canon)
on Aug 31, 2005 at 04:48 UTC ( #488021=note: print w/replies, xml ) Need Help??


in reply to How can I download HTML and save it as txt?

Here's one way I can think of:
use LWP::Simple; use HTML::TreeBuilder; use IO::File; IO::File ->new( "> $file" ) ->print( HTML::TreeBuilder ->new_from_content( get $url ) ->as_text )
Short and sweet. But lacking any kind of error handling. :-(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://488021]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-04-25 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?