Login Search

An introduction to research

Last Post
#248

Default

Not trying to be a jerk, but did you even read this thread? Start at page 1 and make an attempt. The links that were posted (by Inspirited, I believe) in a previous thread you started will also be very helpful. Ask specific questions when you run into problems.

Or, if you're looking for classroom instruction, take (or audit) a course at a community college. Good luck.
#252

Default

Quote Originally Posted by bobbydrake View Post
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.
Forgive my ignorance...... but how would I actually utilize this script? Do I upload to a server cgibin and then go to the page? I mean how do I get this script to run?