Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2018-07-23 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (459 votes). Check out past polls.

    Notices?