Skip to site navigation (Press enter)

HTML::TokeParse into @array

Torbj�rn Lindahl Tue, 01 Oct 2002 20:10:50 -0700

Hello list,

I wish to parse a HTML document and put all tables found into a regular
array. All HTML tables will have rectangular configuration.

I looked into the HTML::TokeParser module for the job, but after a
frustrating hour or two I cant figure out how to do it.

This is what I want to do:

Pseudocode:

while(get_tag("table")){
while(get_tag("tr")){
$r_index++;
while(get_tag("td")){
$d_index++;
#put contents into @array at $r_index and $d_index
}
}
}

But I am not able to limit the inner loops to the span of the table or the
row only, ie get_tag("tr") will run across table barriers.

If someone could give pointers to good HTML::TokeParser tutorials or help
me with this specific problem, I would be very greatful.

Regards,
Torbj�rn Lindahl

  • Previous message
  • View by thread
  • View by date
  • Next message

Reply via email to

The Mail Archive
  • The Mail Archive home
  • libwww - all messages
  • libwww - about the list
  • Expand
  • Previous message
  • Next message
  • The Mail Archive home
  • Add your mailing list
  • FAQ
  • Support
  • Privacy
  • [email protected]