• 请不要在回答技术问题时复制粘贴 AI 生成的内容
niuniu20013
V2EX  ›  程序员

casperjs 模拟支付宝登陆遇到问题. 行得通么?

  •  
  •   niuniu20013 · Mar 24, 2017 · 2497 views
    This topic created in 3364 days ago, the information mentioned may be changed or developed.

    在做点东西. 遇到一个模拟支付的问题, 求有否同学遇到过类似的问题? 求个解决?

    1. 跳转支付 这一步没问题

    2. 输入账号密码

    到这一步就有问题. 不能正确的输入密码. 使得在点击'下一步'时总提示'请填写支付密码'. 不知是否密码输入框做了什么限制?

    核心的代码在下面, 有招的同学帮忙给看看?

    var pay = function() {
        var self = this;
        self.print('i am in pay');
        self.wait(2000, function() {
            self.capture('2.png');
        });
        self.print('i am in pay2');
        var s_img = '#J_qrPayArea > div.qrcode-img-wrapper > div.qrcode-img-area > div > img';
        self.waitForSelector(s_img, function() {
            self.print('i am in pay3');
            self.waitForSelector('#J_tip_qr > a', function() {
                self.click('#J_tip_qr > a');
                self.waitForSelector('#J_tip_pc > a', function() {
                    self.wait(2000, function() {
                        self.waitForSelector('#J_tLoginId', function() {
                            self.print('i am in input account');
                            self.evaluate(function() {
                                var account = '';
                                var pwd = '';
                                document.querySelector('#J_tLoginId').value = account;
                                document.querySelector('#payPasswd_input').value = pwd;
                                document.querySelector('#J_newBtn').click();
                            });
                            //self.fill('#J_TloginForm', {
                            //    'loginId' : a,
                            //    'payPasswd_rsainput' : b
                            //}, true);
                            self.wait(4000, function() {
                                self.capture('3.png');
                            })
                        });
                    });
                });
            });
        });
    }
    
    5 replies    2017-03-28 12:53:25 +08:00
    LeeSeoung
        1
    LeeSeoung  
       Mar 24, 2017   ❤️ 1
    - -那个不是控件么
    neoblackcap
        2
    neoblackcap  
       Mar 24, 2017   ❤️ 1
    做过,坑很大,这些相对于支付宝的风控都不是事
    artandlol
        3
    artandlol  
       Mar 24, 2017 via Android   ❤️ 1
    做过,登陆手机版的
    niuniu20013
        4
    niuniu20013  
    OP
       Mar 28, 2017
    @neoblackcap 详细说下?
    niuniu20013
        5
    niuniu20013  
    OP
       Mar 28, 2017
    @artandlol 给个思路, 哥?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3296 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 13:10 · PVG 21:10 · LAX 06:10 · JFK 09:10
    ♥ Do have faith in what you're doing.