Dear my friends...
I want to parse HTML files those I retrieve with "LWP::UserAgent". For the
parsing I use "HTML::Parser".
But the parsing process does not give any result. I still do not understand the
documentation those I get from
- http://www.foo.be/docs/tpj/issues/vol5_1/tpj0501-0003.html ;
- http://search.cpan.org/~gaas/HTML-Parser-3.56/Parser.pm .
Please tell me where my mistake for making me understand how to use this HTML
Parser Module.
===
Here is my current code:
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTML::Parser;
my @result='';
my $tekshslparse='';
my $ua = LWP::UserAgent->new;
$ua->agent("Mozilla/8.0");
my $req = HTTP::Request->new(GET => 'http://www.google.com');
$req->header('Accept' => 'text/html');
my $retriveresult = $ua->request($req);
my $p=new HTML::Parser;
$tekshslparse=$p->parse($retriveresult);
print @result;
sub text{
my($self, $text)[EMAIL PROTECTED];
print "self: $self \n\n";
print "text: $text \n\n";
}
--
Patrik Hasibuan <[EMAIL PROTECTED]>
Junior Programmer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/