List:General Discussion« Previous MessageNext Message »
From:efrazier Date:June 23 1999 6:34pm
Subject:parsing finaly got it.
View as plain text  
It isn't pefect, but I got it. I still don't understand a lot of the
contents of the email that was sent to me about this. But it certainly has
given me a start. Thanks to everyone!

Eric 

#!/usr/bin/perl


 BEGIN {
    push(@INC, '/home2/kwinternet/webclient/URI-1.02');
	push(@INC, '/home2/kwinternet/webclient/HTML-Parser-2.23/');
	
 }

use LWP::Simple;
use HTML::TokeParser;

$page = "http://www.kwinternet.com/chris/beasts.html";
open (TEMP,">temp.html");

foreach (get $page) {
 	
	~ s/\./\n/g;
	~ s/\&nbsp\;//g;
	~ s/\&quot\;/"/g; # I know there is better stuff than this, but I expected
the TokeParser to do more than it does. 
	
	print TEMP;	
}
close(TEMP);

my $p = HTML::TokeParser->new("temp.html");


# This prints the text as it is on the page
# newlines and all
# 
while(my $token = $p->get_token) {
	print $token->[1] if $token->[0] eq 'T';
}


Thread
parsing finaly got it.efrazier23 Jun