Re: HTML Parsing issues - Part II

On May 25, 5:15 am, Gunnar Hjalmarsson <nore...@xxxxxxxxx> wrote:
cha...@xxxxxxxxxxxxxxxx wrote:
I'm trying to have the following script parse

<table class="item_description">
<td>Acer Aspire AS5610-2089 Notebook, Intel Pentium Dual Core
T2080, 1.6 GHz, 1024GB, 160GB, DVD+/-R DL/DVD+RW Drive, 15.4" TFT,
WebCam, 56K Modem, Wireless, NIC, Vista Home Premium, Refurbished with
90 Day Warranty</td>

From the following url

use LWP::Simple;
use HTML::TokeParser;

my $html = get '';
my $p = HTML::TokeParser->new( \$html );

while ( my $table = $p->get_tag('table') ) {
last if $table->[1]{class} and
$table->[1]{class} eq 'item_description';
print $p->get_trimmed_text('/td');


How did you know to use $table->[1]{class} and say not $table->[0]
{class}? Is there something in the documentation that I missed?