Hello,
I am new to Perl and trying to learn it by doing some reading and by writing some simple programs, for example I am trying to access a website and extract data for a pet project (but not for commercial use).
I found the module TableExtract in CPAN and successfully installed it. I am trying to access the table values in this site:
I have built some preliminary code, but unfortunately I cannot complete the task to access the data values in the table that comes up in the webpage. The 4 columns I am hoping to access are Company, Symbol, EPS Estimate, EPS Actual. I want to print each row in the table, showing the values of the 4 columns in each row.
This is the code I have written so far:
#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
use HTML::TableExtract;
my ($te, $url);
$url="
$te = new HTML::TableExtract( headers =>
[qw(Company Symbol)] );
$te->parse($url);
Can someone please give me some guidance on how to proceed? Your help would be greatly appreciated!
Many thanks,
Joe
I am new to Perl and trying to learn it by doing some reading and by writing some simple programs, for example I am trying to access a website and extract data for a pet project (but not for commercial use).
I found the module TableExtract in CPAN and successfully installed it. I am trying to access the table values in this site:
I have built some preliminary code, but unfortunately I cannot complete the task to access the data values in the table that comes up in the webpage. The 4 columns I am hoping to access are Company, Symbol, EPS Estimate, EPS Actual. I want to print each row in the table, showing the values of the 4 columns in each row.
This is the code I have written so far:
#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
use HTML::TableExtract;
my ($te, $url);
$url="
$te = new HTML::TableExtract( headers =>
[qw(Company Symbol)] );
$te->parse($url);
Can someone please give me some guidance on how to proceed? Your help would be greatly appreciated!
Many thanks,
Joe