Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^4: How to dump a webpage content into a excel

by ghosh123 (Monk)
on Apr 23, 2013 at 11:09 UTC ( [id://1030102]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How to dump a webpage content into a excel
in thread How to dump a webpage content into a excel

Hi
Yes , I commented out the add_worksheet line inside the foreach loop and created only one worksheet before the for each loop (please see below).
Also, iterating the $nrow++ one more time after the $ts->rows foreach. Please correct me .

my $worksheet = $workbook->add_worksheet("Table"); my $te = HTML::TableExtract->new( keep_html => 0 ); $te->parse($response); my $counter; foreach my $ts ($te->tables) { # my $worksheet = $workbook->add_worksheet("Table ".$counter++); my $nrow=0; foreach my $row ($ts->rows) { my $ncol=0; foreach my $col (@$row) { $worksheet->write($nrow,$ncol++,$col) if defined $col; } $nrow++; } $nrow++; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-23 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found