2017-10-16 17 views
1

Ce code que j'ai écrit sur mon bureau et fonctionnait sous Windows 10 et tout fonctionne. Quand j'ai déménagé à Centos Server, j'ai commencé à avoir des erreurs. Aidez-moi s'il vous plaîtCasperJS ne fonctionne pas sur Centos Server, mais fonctionne sur Windows 10

CasperError: Cannot get informations from input[name="email"]: element not found. 
    /home/casper/casperjs/phantomjs:/platform/casper.js:1158 in getElementInfo 
    /home/casper/casperjs/phantomjs:/platform/casper.js:1721 in sendKeys 
    /home/casper/casperjs/phantomjs:/code/cars.js:9 
    /home/casper/casperjs/phantomjs:/platform/casper.js:1685 in runStep 
    /home/casper/casperjs/phantomjs:/platform/casper.js:414 in checkStep 

var casper = require('casper').create(); 
 

 
casper 
 
    .start('https://example.com', function() { 
 
    this.echo(this.getTitle()); 
 
    this.click("span.btn.btn-green"); 
 
    }).wait(5000).then(function() { 
 
\t  this.capture('sdsdsd.png'); 
 
     this.sendKeys('input[name="email"]', 'name'); 
 
     this.sendKeys('input[name="password"]', 'pass'); 
 
     this.click("button.btn.btn-h40.btn-green.btn-fw.btn-submit"); 
 
     console.log("Auth"); 
 

 
    }) 
 
casper.run();

+0

La capture d'écran capturée a-t-elle une réponse valide? – Garfield

+0

@ Cut-n-paster merci pour la réponse. J'ai trouvé le problème, c'était l'erreur de poignée de main de SSL. – Injection

Répondre