awohld has asked for the wisdom of the Perl Monks concerning the following question:
Using this code:<select name=market onChange="setCookie(this.name,this.selectedInd +ex)"> <option value=Chicago>Chicago <option value=Wisconsin>Wisconsin <option value=Indiana>Indiana </select>
My Dumper is givng:my $baseSpPage = 'http://www.example.com/'; my $mech = WWW::Mechanize->new(); $mech->get("$baseSpPage"); my $html = $mech->content(); my $stream = HTML::TokeParser->new(\$html); while ( my $token = $stream->get_token ) { if ($token->[0] eq 'S') { if ($token->[1] eq 'select') { print Dumper $token; } } }
How do I get the select list out of here? I'd like to pack it into an array.$VAR1 = [ 'S', 'select', { 'onchange' => 'setCookie(this.name,this.selectedIndex)', 'name' => 'market' }, [ 'name', 'onchange' ], '<select name=market onChange="setCookie(this.name,this.sele +ctedIndex)">' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::TokeParser Select List into Array
by wfsp (Abbot) on Oct 18, 2005 at 07:48 UTC | |
|
Re: HTML::TokeParser Select List into Array
by graff (Chancellor) on Oct 18, 2005 at 12:54 UTC |