1

This code I wrote on my desktop and ran under Windows 10 and everything works. When I moved to Centos Server, I started to get errors. Help me please

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 () {
     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();
Injection
  • 301
  • 3
  • 8

1 Answers1

1

Use the phantomjs option --ignore-ssl-errors=true to byepass the SSL certification validation. For more info https://casperjs.readthedocs.io/en/latest/cli.html#casperjs-native-options

Garfield
  • 2,487
  • 4
  • 31
  • 54