amantでログインするにはPhantomJsとCasperJsを使用していますが、複数回ログインするとamazonがCaptchaを与えスクリプトが失敗します。私はそれがcaptchaを持っている場合ログインスクリプトを処理する方法を知らない。ここにcaptchaがなければうまく動作する私の現在のコードです。amazonでCasperJSを使用してCaptchaを処理する
var casper = require('casper').create();
var AMAZON_USER = 'amazon-username';
var AMAZON_PASS = 'amazone-password';
casper.start('https://www.amazon.com/gp/wallet', function() {
this.echo('Loggin into amazon...');
var emailInput = 'input#ap_email';
var passInput = 'input#ap_password';
this.mouseEvent('click', emailInput, '15%', '48%');
this.sendKeys('input#ap_email', AMAZON_USER);
this.wait(3000, function() {
this.mouseEvent('click', passInput, '12%', '67%');
this.sendKeys('input#ap_password', AMAZON_PASS);
this.mouseEvent('click', 'input#signInSubmit', '50%', '50%');
});
});
casper.then(function (e) {
this.capture('amazon.png');//print screen shot after login
});
casper.run();
ありがとうございます。
Tesseractはamazonのcaptchaの問題を読んでいるようです。あなたのシステムにそれをインストールしてから、Casperを使って外部コマンドを実行してそれを解決し、出力を返すことができます。 – drew010