tanger has asked for the wisdom of the Perl Monks concerning the following question:
<td><div class="banner"><span id="fulldescription" class="text11g"><b> +Description:</b></span></div> </td> </tr> </table> <div align="center" style="padding-top:13"> <table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <div class="text12"> Season one of the ladder contest runs from July 1, 2004 to September 3 +0, 2004. During this time, all solo and 2v2 games on the Lordaeron, A +zeroth, Kalimdor, and Northrend Gateways will be tracked by Blizzard. + The players with the most experience in ladder play will then be mat +ched against each other in a series of tournaments to determine the u +ltimate winner in both the Solo and 2v2 formats. </div> </td>
if ($token->[0] eq 'S' and $token->[1] eq 'div' and ($token->[2]{'class'} || '') eq 'text12') { print $stream->get_trimmed_text('/div'); }
the above code prints out nothing because i know i'm doing the coding wrong for this. I'm not sure on how to do the token sequence parsing so it narrows it down more.while(my $token = $stream->get_token) { if ($token->[0] eq 'S' and $token->[1] eq 'span' and ($token->[2]{'id'} || '') eq 'fulldescription') { #found the <span class="fulldescription"> tag if ($token->[0][0] eq 'S' and $token->[0][1] eq 'div' and ($token->[0][2]{'class'} || '') eq 'text12') { print $stream->get_trimmed_text('/div'); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing this HTML description
by tachyon (Chancellor) on Oct 27, 2004 at 10:11 UTC | |
|
Re: Parsing this HTML description
by skillet-thief (Friar) on Oct 27, 2004 at 11:21 UTC |