phantom.casperPath +('/Users/AustinJ/Desktop/streakscraper/node_modules/casperjs');
phantom.injectJs = (phantom.caperPath + '/Users/AustinJ/Desktop/streakscraper/node_modules/casperjs/bin/bootstrap.js');
var utils = require('smx-casper-utils');
var casper = require('casper').create();
casper.userAgent('Chrome/58.0.3029.81');
casper.start('http://streak.espn.com/en/').viewport(1200, 1000);
var x = require('casper').selectXPath;
casper.start('http://streak.espn.com/en/entry').viewport(1200, 1000);
casper.wait(3000, function() {
casper.capture('test1.jpg');
casper.click(x('//*[@id="matchupDiv"]'));
});
casper.wait(3000, function() {
casper.capture('test2.jpg');
});
casper.run();
Update: No error - here is the correct code. For some reason when I run casperjs click.js in the terminal it works instead of using phantomjs click.js. Hope this helps anyone else who runs into this problem.