a_non_moose has asked for the wisdom of the Perl Monks concerning the following question:
Now, my boss (who knows a bit more practical experience with perl) and I have been trying different things to brute force data extraction, but usually wound up with a ton of tags and other XML garbage printing out.use HTML::Parser (); sub start_handler { return if shift ne "table"; my $self = shift; $self->handler(text => sub { print shift }, "dtext"); $self->handler(end => sub { shift->eof if shift eq "table"; }, "tagname,self"); } my $p = HTML::Parser->new(api_version => 3); $p->handler( start => \&start_handler, "tagname,self"); $p->parse_file(shift || die) || die $!; print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Should I use; Html Parser, table extract, Extractor
by GrandFather (Saint) on Dec 20, 2005 at 22:50 UTC | |
|
Re: Should I use; Html Parser, table extract, Extractor
by ikegami (Patriarch) on Dec 20, 2005 at 22:28 UTC | |
|
Re: Should I use; Html Parser, table extract, Extractor
by mojotoad (Monsignor) on Dec 21, 2005 at 22:23 UTC | |
by a_non_moose (Initiate) on Dec 22, 2005 at 05:31 UTC | |
|
Re: Should I use; Html Parser, table extract, Extractor
by a_non_moose (Initiate) on Dec 21, 2005 at 04:27 UTC | |
|
Re: Should I use; Html Parser, table extract, Extractor
by gu (Beadle) on Dec 21, 2005 at 08:21 UTC |