Rhodium has asked for the wisdom of the Perl Monks concerning the following question:
What I am looking for is something that will put the two things that I care about - the name of the select and the named value of the selected item. So for this I would expect the following:<TD style="HEIGHT: 29px"> <select name="cmbPurpose" id="cmbPurpose" tabindex="3"> <option value="CD">Cell Development</option> <option value="MS">Miscellaneous R&D</option> <option value="NP">New Package</option> <option value="NR">Non R&D</option> <option value="PC">New process</option> <option selected="selected" value="PD">New product</option> <option value="SP">Sustaining Product</option> <option value="SW">Software and Platform</option> <option value="TD">Technology Development</option> </select></TD>
I don't understand why I am so braindead on this simple idea..use HTML::TokeParser; my $p = HTML::TokeParser->new( \$webpage->content ); while (my $token = $p->get_tag("select")) { my $select = $token->[1]{name} ; print "$select\n"; }
The seeker of perl wisdom.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trouble Parsing HTML
by Util (Priest) on Jan 28, 2005 at 22:27 UTC | |
by Rhodium (Scribe) on Jan 29, 2005 at 14:20 UTC | |
|
Re: Trouble Parsing HTML
by saintmike (Vicar) on Jan 28, 2005 at 22:11 UTC | |
|
Re: Trouble Parsing HTML
by Aristotle (Chancellor) on Jan 28, 2005 at 23:20 UTC | |
|
Re: Trouble Parsing HTML
by nerfherder (Monk) on Jan 28, 2005 at 22:47 UTC | |
|
Re: Trouble Parsing HTML
by Popcorn Dave (Abbot) on Jan 29, 2005 at 05:37 UTC | |
|
Re: Trouble Parsing HTML
by bgreenlee (Friar) on Jan 28, 2005 at 22:07 UTC |