这是我在 Android Market for Developers (market.android.com/publish) 中使用的代码:
use WWW::Mechanize;
use HTTP::Cookies;
my $url = 'https://www.google.com/accounts/ServiceLogin';
my $username = 'username@gmail.com';
my $password = "PASSWORD";
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 = 'https://market.android.com/publish/Home';
$mech->get($url);
print $mech->content();
这是 Prateek 发布的链接的小编辑/清理:http: //gregjessup.com/login-to-google-using-perl。我认为它应该可以用于大多数需要您登录的 Google 服务。