in reply to HTML::Tokeparser and $attr problem
You are not checking the token type. You only want to check the starting 'a' tag.
#! c:\perl\bin -w use strict; use HTML::TokeParser; my $p = HTML::TokeParser->new(shift||die); while (my $token = $p->get_token) { print $token->[2]{'href'}, "\n" if ($token->[0] eq 'S' && $token->[1 +] eq 'a'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: HTML::Tokeparser and $attr problem
by dannoura (Pilgrim) on Apr 24, 2004 at 18:13 UTC |