my @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="
| City | Address | Type | Contact Name | Contact | List Price |
|---|
| 123 Any Street, Anytown | SFR | Any Person | 778-123-4567 | 59,675 |
|---|
" ;
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=| City | Address | Type | Contact Name | Contact | List Price |
|---|
1971 E 49th Avenue | SFR | Gurpreet Dhesi | 778-893-1295 | 59,675 |
table_extractor=HTML::TableExtract=HASH(0x8790d50)
table_extractor->tables=0