Skip to content

Instantly share code, notes, and snippets.

@rahul-desai3
Created October 19, 2015 00:11
Show Gist options
  • Save rahul-desai3/8ee6f5322e17a34116ba to your computer and use it in GitHub Desktop.
Save rahul-desai3/8ee6f5322e17a34116ba to your computer and use it in GitHub Desktop.
Trying nightmare.js
var Nightmare = require('nightmare');
var vo = require('vo');
var link = 'https://www.cordbloodbanking.com/';
vo(run)(function(err, result) {
if (err) throw err;
});
var moduleFnArg1 = 1;
var moduleFnArg2 = 2;
var moduleFn = function(arg1, arg2){
console.log( "Got arg1 as %s, and arg2 as %s", arg1, arg2)
};
function *run() {
var nightmare = Nightmare();
var n = yield nightmare
.goto(link)
.evaluate(moduleFn, moduleFnArg1, moduleFnArg2);
yield nightmare.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment