A modern puppeteer-based driver for x-ray.
Forked from x-ray-phantom.
// add to package.json
"x-ray-puppeteer": "git+https://[email protected]/ealanisg/x-ray-puppeteer.git#main",
Basic usage should be the same as request-x-ray:
var puppeteer = require('x-ray-puppeteer');
var Xray = require('x-ray');
var x = Xray()
.driver(puppeteer());
x('http://google.com', 'title')(function(err, str) {
if (err) return done(err);
assert.equal('Google', str);
done();
})
Initialize the puppeteer driver. Returns an X-Ray driver function with the puppeteer instance saved as fn.instance
property.
options
arg is passed direct to puppeteer. The following are custom options that configure the driver itself:
Sets a custom User Agent during instance setup via page.setUserAgent()
or a default one will be used.
yarn install
yarn test
MIT