我正在尝试使用 perl 登录网站,但我无法完成,这是我实际编写的代码:
package Vk;
use strict;
use warnings;
use LWPx::ParanoidAgent;
use HTML::TokeParser;
use XML::TokeParser;
use Time::HiRes qw/ usleep /;
use URI::Escape;
my $url = 'https://login.vk.com/?act=login';
sub run
{
my ($class, $conf, $rows) = @_;
print "trying to log in ... \n\n";
my $ua = LWPx::ParanoidAgent->new(
agent => $conf->{HTTP_USER_AGENT},
timeout => $conf->{HTTP_TIMEOUT}
);
my $request = POST($url,
{
'act' => 'login',
'role' => 'al_frame',
'expire' => '',
'captcha_sid' => '',
'captcha_key' => '',
'_origin' => 'http://vk.com',
'ip_h' => '****************',
'email' => '**********',
'pass' => '******',
}
);
print "YOUR ARE LOGGED IN VK ....\n\n\n\n\n\n";
...........
此代码仅打印“尝试登录 ...”,但未达到您已登录 VK ...。
谢谢。