某理财公司的登录请求

来源:互联网 发布:怎么更改淘宝店铺域名 编辑:程序博客网 时间:2024/05/10 09:10

post 登录直接用username和password 

# Copyright 2014 tkorays. All rights reserved.# author tkorays# email tkorays@hotmail.comuse LWP;use LWP::Simple;use LWP::UserAgent;use HTTP::Cookies;use HTTP::Headers;use HTTP::Response;use Encode;use URI::Escape;use URI::URL;  my $email = 'zhao.yangjian@163.com'; my $password = 'xxxxx'; my $domain = 'renren.com'; my $hostid=''; my $requestToken=''; my $rtk=''; my $channel='renren';    my $ua = LWP::UserAgent->new;  $ua->agent("Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 Firefox/30.0");  my $cookie_jar = HTTP::Cookies->new(      file=>'lwp_cookies.txt',          autosave=>1,              ignore_discard=>1);              $ua->cookie_jar($cookie_jar);                              my $login_url = 'https://www.duc365.com/login.html';                                # 这里面没有判断是否需要验证码,聪明的你学完后肯定知道怎么搞定的                # 人人是post登陆的,第一个参数是登陆的地址,第二个参数是一个匿名hash                my $res = $ua->post($login_url,{                        'username'=>18072722237,                                'password'=>xxxx                                        });                                        my $homepage;                                         # 判断响应头里面的location,确定是否登陆成功                                           print "---------------\n";                                        print $res->header('Location');                                        print "---------------\n";                                                $homepage = $ua->get('http://www.duc365.com/myhome/center.html;jsessionid=F2136BA4B236ACAD95B2D93D00B9D998?username=18072722237'); print $homepage->decoded_content;                                                $cc=$ua->get('https://www.duc365.com/myhome/integral/all.html');print "\###########################################################################################################\n";print $cc->decoded_content;


0 0
原创粉丝点击