Using LWP and HTML::FormatText to retrieve text from a page in Perl

!/usr/bin/perl -w use strict; use HTML::TreeBuilder; use HTML::FormatText; use LWP::Simple; my $webpage = get(“http://www.w3mentor.com”); my $htmltree = HTML::TreeBuilder->new->parse($webpage); my $output = HTML::FormatText->new(); print

$output->format($htmltree);

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.