- There are two config now, one is global config, another is job config.
- global config can be used by .opt
var urlExtract = require('../');
urlExtract.opt({
viewportSize: {
width: 800,
height: 400
},
clipRect: {
top: 0,
left: 0,
width: 800,
height: 400
}
});
urlExtract.snapshot('http://www.baidu.com', function (job) {
console.log('This is a snapshot example.');
console.log(job);
process.exit();
});
* job config can be used by .extract or .snapshot
```js
var urlExtract = require('../');
urlExtract.snapshot('http://www.baidu.com', {
viewportSize: {
width: 800,
height: 400
},
clipRect: {
top: 0,
left: 0,
width: 800,
height: 400
},
callback: function (job) {
console.log('This is a snapshot example.');
console.log(job);
process.exit();
}
});