A modern nightmare-based driver for x-ray.
Forked from x-ray-phantom.
// add to package.json
"x-ray-nightmare": "github:cayleyh/x-ray-phantom#nightmare",
Basic usage should be the same as request-x-ray:
var nightmare = require('x-ray-nightmare');
var Xray = require('x-ray');
var x = Xray()
.driver(nightmare());
x('http://google.com', 'title')(function(err, str) {
if (err) return done(err);
assert.equal('Google', str);
done();
})
Initialize the nightmare driver. Returns an X-Ray driver function with the nightmare instance saved as fn.instance
property.
options
arg is passed direct to Nightmare. The following are custom options that configure the driver itself:
Sets a custom User Agent during instance setup via nightmare.useragent()
.
npm install
npm run test
MIT