#!c:\\perl\\bin use strict; use WWW::Mechanize; use HTTP::Cookies; ###go to login page and login. #you will need IO-Socket-SSL installed #that can be found at http://search.cpan.org/~sullr/IO-Socket-SSL-1.24/ my $url = https://www.google.com/accounts/ServiceLogin?hl=en&service=finance&nui=1&continue=http%3A%2F%2Ffinance.google.com%2Ffinance'; my $username = "username\@gmail.com"; #notice I escaped the email address my $password = "yourpassword"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_number(1); $mech->field(Email => $username); $mech->field(Passwd => $password); $mech->click(); #Go to the next link, now that we are logged in. $url = 'http://finance.google.com/finance/portfolio?action=view&pid=1&pview=pview&output=csv'; $mech->get($url); my $output_page = $mech->content(); print $output_page;