On Sat, Jul 08, 2006 at 07:06:15PM +0300, Gabor Szabo wrote:
> Specifically I know there should be two tables on the page.
> One of them belongs to a form the other one should contain a
> list of device names. How can I retreive the list of tables and then how
> can I parse the tables?

Me, I'd use HTML::TreeBuilder:
http://search.cpan.org/~sburke/HTML-Tree-3.18/lib/HTML/TreeBuilder.pm

1) Build a tree out of your HTML file:
                my $html_file = 'whatever_your_filename_is';
                my $tree = new HTML::TreeBuilder;
                $tree->parse_file($html_file);

2) Extract all the tables:
                my @tags = $tree->look_down("_tag", 'table');

Step 2) uses look_down(), which is a method inherited from
HTML::Element:
http://search.cpan.org/~sburke/HTML-Tree-3.18/lib/HTML/Element.pm

Now you've got a list of your tables, which you can then
walk through as you please.

-- 
Stephen R. Laniel
[EMAIL PROTECTED]
Cell: +(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key

Attachment: signature.asc
Description: Digital signature

Reply via email to