> use HTML::PullParser;
> use Data::Dump qw(dump);
> 
> $doc = <<'EOT';
> <TITLE>Foo</TITLE>
> <script>
> <foo>
> </script>
> 
> <h1>Hi</h1>
> EOT
> 
> my $p = HTML::PullParser->new(doc => $doc,
>       start => 'event,tagname',
>       end   => 'event,tagname',
>       ignore_elements => ['script'],
>      );
> 
> while (my $t = $p->get_token) {
>     print dump($t), "\n";
> }
> ---------------------------------------------------------------------
> This will produce:
> 
> ["start", "title"]
> ["end", "title"]
> ["start", "h1"]
> ["end", "h1"]


how to access the "Hi" within <h1> tags?



Reply via email to