- 论坛徽章:
- 0
|
刚开始学perl,前段时间在网上自己找的淘宝登陆,以前用的时候还是能够正常登陆的,现在用反而登陆不了,求各位大大给我点指引。
代码如下
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new(cookie_jar => {},);
$ua->default_header( 'Referer' => 'https://login.taobao.com/member/login.jhtml' );
my $res= $ua->post('https://login.taobao.com/member/login.jhtml',
[
TPL_username => '登陆测试',
TPL_password => '123abc',
actionForStable => 'enable_post_user_action',
action => 'Authenticator',
event_submit_do_login => 'anything',
],
);
$res = $ua->get('http://i.taobao.com/my_taobao.htm?');
open(FILE, '>tmall4.html');
print FILE $res->content;
close FILE;
账号密码都是正确的,get出的html文件还是原来登陆界面不是我需要的我的淘宝界面,说明没有正常登陆。 |
|