Hola Víctor eres muy amable este es el código que uso
var casper = require('casper').create({
verbose: true,
logLevel: 'debug',
userAgent: 'Mozilla/5.0 (X11; Ubuntu...o/20100101 Firefox/31.0',
pageSettings: {
webSecurityEnabled: false,
resourceTimeout: 240000
},
waitTimeout: 500000,
stepTimeout: 500000
});
var mouse = require("mouse").create(casper);
var x = require('casper').selectXPath;
url = 'https://mega.co.nz/#!Epc1lQDR!OizwN05pvADO6tabZv5eqSlxWscUm0noqpreDWCjQ-o';
casper.start(url);
casper.then(function() {
this.capture('antes.png',undefined, {
format: 'png',
quality: 100});
});
casper.then(function() {
var count = 1000 * 5;
this.wait(count);
});
casper.then(function() {
this.capture('despues.png',undefined, {
format: 'png',
quality: 100});
});
casper.thenClick(x('//*[@class="new-download-red-button"]'));
casper.then(function() {
var count = 1000 * 20;
this.wait(count);
});
casper.then(function() {
this.capture('despues2.png',undefined, {
format: 'png',
quality: 100});
});
casper.run();