rendered paste bodymy @headers = ('City', 'Address', 'Type', 'Contact Name', 'Contact', 'List Price') ;
my $table_extractor = HTML::TableExtract->new( headers => \@headers ) ;
#my $table_extractor = HTML::TableExtract->new( depth => 0, count => 0 ) ;
#my $content=$response->content ;
my $content="<table><tr><th>City</th><th>Address</th><th>Type</th><th>Contact Name</th><th>Contact</th><th>List Price</th></tr><tr><th>123 Any Street, Anytown</th><th>SFR</th><th>Any Person</th><th>778-123-4567</th><th>59,675</th></tr></table>" ;
print "content=" . $content . "\n" ;
$table_extractor->parse(\$content) ;
print "table_extractor=" . $table_extractor . "\n" ;
my $table_data ;
print "table_extractor->tables=" . $table_extractor->tables . "\n" ;
foreach $table_data ( $table_extractor->tables ) {
print "table_data=" . $table_data . "\n" ;
my $row ;
foreach $row ( $table_data->rows ) {
print join( ',', @$row ), "\n" ;
}
}
:!./post_countrywide.pl
Input 'PageNum' is readonly at /usr/lib/perl5/site_perl/5.8.7/WWW/Mechanize.pm line 1227
content=<table><tr><th>City</th><th>Address</th><th>Type</th><th>Contact Name</th><th>Contact</th><th>List Price</th></tr><t
r><th>1971 E 49th Avenue</th><th>SFR</th><th>Gurpreet Dhesi</th><th>778-893-1295</th><th>59,675</th></tr></table>
table_extractor=HTML::TableExtract=HASH(0x8790d50)
table_extractor->tables=0