use LWP::UserAgent;
use HTTP::Cookies;
use HTTP::Headers;
use HTTP::Response;
use Encode;
use File::Temp qw/tempfile/;
my $ua = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, );;
$ua->timeout(10);
$ua->env_proxy;
my $now = time();
$ua->agent("Mozilla/8.0");
my $cookie_jar = HTTP::Cookies->new( file => 'lwp_cookies.txt',
autosave => 1,
ignore_discard => 1
);
$ua->cookie_jar($cookie_jar);
my $str=(rand(1));
#system ("del/f/s/q c:\wj_qrcod*.jpg");
my $response = $ua->get("https://www.zjtest2.com/validcode/generate-validcode.do?$str"); print "\$str is $str\n";
if ($response->is_success) {
$r = $response->decoded_content;
# print $response->decoded_content; # or whatever
}
else {
print $response->decoded_content;
die $response->status_line;
}; my ( $fh, $filename ) =
tempfile( "wj_qrcode_XXXX", SUFFIX => ".jpg", DIR => 'c:\\' );
binmode $fh;
print $fh $r;
close $fh;
print "登录二维码已经下载到本地 [ $filename ] \n"; ##打开图片
system("start $filename "); my $validCode = <STDIN>;
chomp $validCode ;
print "\$validCode is $validCode\n"; #my $url="https://www.zjtest2.com/business/dispatch_post.do"; my $login_url = 'https://www.zjtest2.com/business/dispatch_post.do'; my $res = $ua->post($login_url,{
'action'=>'doLogin',
'userName'=>'kevin',
'followId'=>'',
'userPass'=>'3d24b838770ee90773804e8599e549ff',
'validCode'=> "$validCode"
});
print "---------------\n"; my $head =$res->header('Location');
print $res->header('Location');
print "\n"; print $res->status_line."\n";
print $res->as_string();#获取的是原始内容,包括响应头,响应正文 my $content=$res->content();
print $res->content(); #获取的是响应正文 my $spool = encode("gbk",decode("utf8","$content"));
print "\$spool is $spool\n";
print "\n"; my $response = $ua->get("$head");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; my $url="https://www.zjtest2.com/business/dispatch_get.do?action=doDeposit";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; while(1==1){ ##转入2级市场现金现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=1&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=1460426257542
##1460426541
my $now = time();
my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; ###转出到1级市场现金
##https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fin&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=1460441529452
###https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=79e8fe923f031f46221a9283d0c9263a&_=$now my $url="https://www.zjtest2.com/web/auth?method=%2Fwze%2Ftransfer%2Fcash%2Fout&amount=2&tradePassword=3d24b838770ee90773804e8599e549ff&_=$now";
my $response = $ua->get("$url");
if ($response->is_success) {
print $response->content;
$r = $response->content; $str=encode("gbk",decode("utf8","$r"));
print "\$str is $str\n"; }else{ $r = $response->content;
print $response->content; }; };

perl lwp关闭ssl校验的更多相关文章

  1. haproxy 关闭ssl 3.0 加密

    global log 127.0.0.1 local3 maxconn 65535 chroot /usr/local/haproxy uid 500 gid 500 daemon ssl-defau ...

  2. 关闭SSL证书验证

    转载 Python3之关闭SSL证书验证 转载 Python requests 移除SSL认证,控制台输出InsecureRequestWarning取消方法 报错信息: Traceback (mos ...

  3. vue项目关闭eslint校验

    [前言] eslint是一个JavaScript的校验插件,通常用来校验语法或代码的书写风格.这篇文章主要介绍了vue项目关闭eslint校验,需要的朋友可以参考下 [主体] 简介eslint esl ...

  4. 用vue ui创建的项目怎么关闭eslint校验

    在Vue Cli的控制面板找到配置-ESLint configuration,然后关闭保存时检查就可以了

  5. perl lwp 超时问题

    lwp 超时问题: jrhmpt01:/root/async# cat a1.pl use LWP::UserAgent; use utf8; use DBI; use POSIX; use Data ...

  6. perl lwp 默认的请求头

    </pre><pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl ...

  7. perl lwp 获取请求头

    <pre name="code" class="html">[root@dr-mysql01 ~]# cat getx.pl use LWP::Us ...

  8. perl LWP::UserAgent获取源码与响应

    #!/usr/bin/perl -w use strict; use LWP::UserAgent; my $useragent = new LWP::UserAgent; my $url = 'ht ...

  9. 关闭SSL服务[iRedMail]

    相信有很多朋友接触并使用地iRedMail这个软件了, 其强大的邮件收发功能, 垃圾及病毒检索能力自不用说了. 其自身携带的dovecot组件提供的SSL也足以使人们对这个软件侧目, 但是正是由于这个 ...

随机推荐

  1. ES6 JavaScript Promise的感性认知

    http://www.zhangxinxu.com/wordpress/2014/02/es6-javascript-promise-感性认知/ 这篇文章讲的很透彻 http://www.zhangx ...

  2. 运行JBoss 5.1.0 GA时出现Error installing to Instantiated:name=AttachmentStore state=Described错误的解决办法

    第一次开JBoss服务器:有些时候会遇到这种情况:把以下的文字替换即可 进到类似目录 server/default/conf/bootstrap,打开文件 profile.xml找到: Xml代码 & ...

  3. 有关android源码编译的几个问题

    项目用到编译环境,与源码有些差异不能照搬,关键是连源码都没编译过,下面基本上是行网上照的各种自学成才的分享,病急乱投医了,都记在下面作为参照吧. 1.验证是否编译正确,在终端执行 emulator & ...

  4. JavaSE复习日记 : 实例化对象/构造方法和this关键字

    /* * 实例化对象/对象的构造方法/this关键字 */ /* * 实例化对象 * * 就是实例化某一个类; * 从不同角度去理解的话就是: * 1. 从人的认知角度: * 就是具体化某个东西; * ...

  5. Scala学习之延迟绑定

    package com.swust.example object TraitDemo2 extends App{ //抽象类 abstract class Writer { def writeMess ...

  6. Struts学习之自定义拦截器

    * 所有的拦截器都需要实现Interceptor接口或者继承Interceptor接口的扩展实现类    * 要重写init().intercept().destroy()方法        * in ...

  7. .Net 类型、对象、线程栈、托管堆运行时的相互关系

    JIT(just in time)编译器 接下来的会讲到方法的调用,这里先讲下JIT编译器.以CLR书中的代码为例(手打...).以Main方法为例: static void Main(){ Cons ...

  8. Spring总结——控制反转,注入(配置和注解两种方式)

    一.Spring的容器: 1.什么是控制反转:传统的方法,当某个java对象A需要调用对象B时,是由调用者(对象A)通过new关键字来创建对象B的(也可以说类A依赖类B),而在Spring中,则是由s ...

  9. Python正则表达式指南(转载)

    转载自:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html#3353540 1. 正则表达式基础 1.1. 简单介绍 正则表达式并不 ...

  10. JConsole是什么

    从Java 5开始 引入了 JConsole.JConsole 是一个内置 Java 性能分析器,可以从命令行或在 GUI shell 中运行.您可以轻松地使用 JConsole(或者,它更高端的 “ ...