Takeru INOUE (井上武) > HTML-TableParser-Grid > HTML::TableParser::Grid

Download:
HTML-TableParser-Grid-v0.0.5.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: v0.0.5   Source  

NAME ^

HTML::TableParser::Grid - Provide access methods to HTML tables by indicating row and column

SYNOPSIS ^

    use HTML::TableParser::Grid;

    # Assuming that $html represents an HTML table like this:
    # +----+----+-------+
    # | 00 | 01 | 02-12 |
    # +----+----+       |
    # |  10-11  |       |
    # +---------+-------+

    my $parser = HTML::TableParser::Grid->new($html);

    $parser->cell(0,0); # 00
    $parser->cell(0,2); # 02-12
    $parser->cell(1,1); # 10-11

    $parser->row(1);    # qw(10-11 10-11 02-12)

    $parser->column(1); # qw(01 10-11)

    ## Indicates 1 offset
    my $parser = HTML::TableParser::Grid->new($html, 1);

    $parser->cell(1,1); # 00

DESCRIPTION ^

HTML::TableParser::Grid provides simple methods to access to HTML tables by indicating row and column. This module takes advantage when many rowspans and/or colspans make the table structure complicated.

METHODS ^

HTML::TableParser::Grid->new($html, [ $offset ])

Creates a new parser object. It is passed a HTML document $html which contains a table, like <table><tr><td> ... </table>. When $html contains more than one table, just the first table is parsed.

If $offset is supplied, the offset of row/column index is specified. Default is zero.

cell($row, $column)

Returns a content of the specified cell.

row($row)

Returns a list of contents in the specified row.

column($column)

Returns a list of contents in the specified column.

num_rows

Returns the number of rows in the table.

num_columns

Returns the number of columns in the table.

_row

SEE ALSO ^

HTML::TableParser

AUTHOR ^

Takeru INOUE <takeru.inoue _ gmail.com>

LICENCE AND COPYRIGHT ^

Copyright (c) 2007, Takeru INOUE <takeru.inoue _ gmail.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY ^

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

syntax highlighting: