Originally Posted by
bobbydrake
Simple Perl Web Parser Script
I don't mean any disrespect toward the original poster's preferred programming language. This is just another method. We all need options in life.
---------------------------------------------------------------
#! /usr/bin/perl
print "Content-type: text/html\n\n";
use LWP::Simple;
use HTML::TreeBuilder;
use HTML::FormatText;
$URL = get("http://www.websiteyouwanttoparse.com");
$Format = HTML::FormatText->new;
$TreeBuilder = HTML::TreeBuilder->new;
$TreeBuilder->parse($URL);
$Parsed = $Format->format($TreeBuilder);
print "$Parsed";
open(FILE, ">file.txt");
print FILE "$Parsed";
close(File);
exit;
--------------------------------------------------------------
Things you need to edit:
$URL = get("http://www.websiteyouwanttoparse.com");
Change the website name to a website you want to parse. If you know a little perl, those quotations have to be included.
and also edit
open(FILE, ">file.txt");
Change file.txt to a file name of your choice. Remember to change this every time you parse a new website or you'll have this program delete all the info on that file from a previous save.
This is my opinion. I take no responsibility for your actions. This is only for educational purposes.