zoukankan      html  css  js  c++  java
  • querylist采集数据 模拟滑动验证码 jcapche

    querylist采集数据 模拟滑动验证码 jcapche
    1.获取验证码token 
    2.模拟传入验证码滑动距离 ,经过检测不低于140

        private function get_slide_distance($distance,$token){
                    $cookieArr = $this->get_jar();
                    $url_capt = "https://*****.cn/gsxt/PlatformSHZZFRKGSXT/slideCaptcha";
                    $url_check = "https://******.cn/gsxt/PlatformSHZZFRKGSXT/slide_captcha_check";
                    $url_check .= "?slideCaptchaToken=".$token."&slidecaptcha=".$distance;
    
    ;            $params1 = [
                'headers' => [
                    'Accept' => 'application/json, text/plain, */*',
                    'Accept-Encoding' => 'gzip, deflate, br',
                    'Cookie' => $cookieArr[0]['Name'] . "=" . $cookieArr[0]['Value'] . "; " . $cookieArr[1]['Name'] . "=" . $cookieArr[1]['Value'],
                    'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8',
                    'Connection' => 'keep-alive',
                    'Content-Length' => 0,
                    'Host' => '******.gov.cn',
                    'Origin' => 'https://******.cn',
                    'Referer' => 'https://*******.cn/gsxt/newList', //不能去掉
                    'Sec-Fetch-Dest' => 'empty',
                    'Sec-Fetch-Mode' => 'cors',
                    'Sec-Fetch-Site' => 'same-origin',
                    'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36'
                ]
            ];
    
    
            try {
                $ql = QueryList::get($url_capt,['slideCaptchaToken'=>$token], $params1);
            } catch (ClientException  $e) {
                echo "<pre>";
                echo $e->getRequest();
                echo $e->getResponse();
                exit();
            }
        /*    echo "<pre>";
            print_r(json_decode($ql->getHtml()));
            exit();*/
    
            try {
                $ql = QueryList::get($url_check,['slideCaptchaToken'=>$token,'slidecaptcha'=>$distance], $params1);
            } catch (ClientException  $e) {
                echo "<pre>";
                echo $e->getRequest();
                echo $e->getResponse();
                exit();
            }
            $re = json_decode($ql->getHtml());
            if($re->code == 200 && $re->result == "success"){
                Cache::set('slidecaptcha'.$token,$distance);
                return $distance;
            }else{
    
            return
                $this->get_slide_distance($distance+2,$token);
            }
    
        }
    

      

    你不能把坏习惯扔出窗外 但你可以一步步赶下电梯
  • 相关阅读:
    hdu6514 // 二维差分 二维前缀和 基本容斥 压维
    【模板】欧拉函数 & 欧拉筛
    并查集模板 hdu1703
    大数 gcd
    hdu1087 dp
    洛谷p1306 斐波那契公约数
    hdu6814 Tetrahedron 线性求逆元 + 快速幂求逆元
    hdu6867 Tree // DFS
    hdu6869 Slime and Stones // 威佐夫博弈&#183;改
    Python实现EXCEL表格的排序功能
  • 原文地址:https://www.cnblogs.com/Ychao/p/14690103.html
Copyright © 2011-2022 走看看