var casper = require('casper').create(); var utils = require('utils'); casper.start('http://localhost:3000', function() { utils.dump(this.getElementInfo('#plaintext')); this.then(function() { this.capture('./out0.png'); }); this.then(function() { this.evaluate(function() { document.getElementById('plaintext').textContent = 'new stuff here'; })}); this.then(function() { this.capture('./out1.png'); }); utils.dump(this.getElementInfo('#plaintext')); }); casper.run();