Re: Extracting a table from a webpage



googlinggoogler@xxxxxxxxxxx wrote:
I would like to scrape all the values from the table http://www.morningstar.co.uk/UK/ISAQuickrank/default.aspx?tab=2&sortby=ReturnM60&lang=en-GB

But im having difficulty getting HTML::TableExtract to achieve this, I keep returning null values.

I decided to play a little with HTML::TableExtract, and this worked fine:

my $te = HTML::TableExtract->new( headers => [
qw(Fund\sName Risk Std\sDev YTD 1\sYr 3\sYr\nAnlsd 5\sYr 10\sYr)
], );
$te->parse($html);
printf "%-42s%-13s%7s%7s%7s%7s%7s%7s\n", @$_
for ($te->tables)[0]->rows;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.