Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; use HTML::Parse; use HTML::FormatText; use LWP::Simple; my $url = "http://www.perlmonks.org"; my $html = get($url); defined $html or die "Can't fetch HTML from: ",$url; my $ascii = HTML::FormatText->new->format(parse_html($html)); print $ascii;
I'm running the code on Mac OS X; Perl, v5.8.8 built for darwin-thread-multi-2level (with 4 registered patches).[TABLE NOT SHOWN][TABLE NOT SHOWN][TABLE NOT SHOWN][TABLE NOT SHOWN] PerlMonks lovingly hand-crafted by Tim Vroom. PerlMonks went on a couple dates, and then decided to shack up with The Perl Foundation. Wonderful Web Servers and Bandwidth Generously Provided by pair Networks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting raw text from a website
by Your Mother (Archbishop) on Dec 03, 2009 at 21:22 UTC | |
|
Re: Extracting raw text from a website
by CountZero (Bishop) on Dec 03, 2009 at 20:32 UTC | |
by Anonymous Monk on Dec 03, 2009 at 20:36 UTC | |
by CountZero (Bishop) on Dec 03, 2009 at 20:52 UTC | |
|