Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: HTML::TableExtractor and embedded columns

by vinoth.ree (Parson)
on Mar 17, 2014 at 08:03 UTC ( #1078577=note: print w/ replies, xml ) Need Help??


in reply to HTML::TableExtractor and embedded columns

how about Using table tag attributes.

use Data::Dumper; use HTML::TableExtract; use Text::Table; my $content = './table.html'; my $headers = ['subhead1', 'subhead2']; #my $te = HTML::TableExtract->new(headers => $headers); my $tbl_extr = HTML::TableExtract->new(attribs => { border => 1 }); my $tbl_out = Text::Table->new(@$headers); $tbl_extr->parse_file($content); foreach my $ts ($tbl_extr->tables) { print "Table with border=1 found at ", join(',', $ts->coords), + ":\n"; foreach my $row ($ts->rows) { print " ", join(',', @$row), "\n"; } }

All is well


Comment on Re: HTML::TableExtractor and embedded columns
Download Code
Re^2: HTML::TableExtractor and embedded columns
by Kyshtynbai (Acolyte) on Mar 17, 2014 at 19:27 UTC
    I'll check that out, thanks. But using attribs doesn't solve the problem. Well, it may solve it in this particular case, but what if no attributes are specified in table tags? That's what I'm thinking about.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1078577]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-10-02 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (61 votes), past polls