zoukankan      html  css  js  c++  java
  • 某理财公司的登录请求

    post 登录直接用username和password 

    # Copyright 2014 tkorays. All rights reserved.
    # author tkorays
    # email tkorays@hotmail.com
    use 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 "---------------
    ";
                                            print $res->header('Location');
                                            print "---------------
    ";
    
                                                    $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 "###########################################################################################################
    ";
    print $cc->decoded_content;


  • 相关阅读:
    SQLServer多表连接查询
    SQLServer基本查询
    SQLServer索引
    SQLServer之数据类型
    设计模式小结
    SQL跨项目查询语法
    利用CountDownLatch和Semaphore测试案例
    JUC包下Semaphore学习笔记
    JUC包下CountDownLatch学习笔记
    JUC包下CyclicBarrier学习笔记
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351228.html
Copyright © 2011-2022 走看看