develooper Front page | perl.libwww | Postings from March 2001

HTML::PullParser

Thread Next
From:
Gisle Aas
Date:
March 26, 2001 11:55
Subject:
HTML::PullParser
Message ID:
lrpuf42tm6.fsf@caliper.ActiveState.com
HTML-Parser-3.19_92 (another dev-only release) is now on CPAN.

The main news is that I tried to make HTML::TokeParser customisable.
That did not work out so I ended up breaking it up into
HTML::PullParser which only provide the get_token/unget_token
interface of HTML::TokeParser.  HTML::TokeParser is now a subclass
that provide the rest of the old interface + hardcoded structure of
tokens.

HTML::PullParser is used like this:

 use HTML::PullParser;
 $p = HTML::PullParser->new(file  => "index.html",
                            start => "event, tag",
                            end   => "event, tag",
                            ignore_elements => [qw(script style)],
                           ) || die "Can't open: $!";

 while (my $token = $p->get_token) {
     #...do something with $token
 }

Is the name ok?

Regards,
Gisle

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About