1

I'm just trying to do this as an exercise to learn casperjs, I'm not trying to cross any ethical borders. Anyway, here is my code:

var casper = require('casper').create({
  verbose: true,
  logLevel: "debug"
});
casper.start('http://twitter.com/signup', function() {
    this.sendKeys('#full-name', username);
    this.sendKeys('#email', email);
    this.sendKeys('#password', password);
    this.click('#submit_button');
});
casper.then(function() {
    this.evaluateOrDie(function() {
        return /message sent/.test(document.body.innerText);
    }, 'sending message failed');
});

casper.run(function() {
    this.echo('message sent').exit();
});

I'm not very sure why this doesn't work. This is the error I get:

Any help would be appreciated.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
  • 4
    When you start your question off by saying that you're not trying to cross "ethical borders" it immediately raises suspicions. – j08691 Nov 26 '15 at 01:43
  • Which PhantomJS version do you use? Please register to the `resource.error`, `page.error`, `remote.message` and `casper.page.onResourceTimeout` events ([Example](https://gist.github.com/artjomb/4cf43d16ce50d8674fdf#file-2_caspererrors-js)). Maybe there are errors. – Artjom B. Nov 26 '15 at 13:41
  • 1
    Possible duplicate of [CasperJS/PhantomJS doesn't load https page](http://stackoverflow.com/questions/26415188/casperjs-phantomjs-doesnt-load-https-page) – Artjom B. Nov 26 '15 at 13:42

0 Answers0