Created
October 19, 2015 00:11
-
-
Save rahul-desai3/8ee6f5322e17a34116ba to your computer and use it in GitHub Desktop.
Trying nightmare.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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