代码拉取完成,页面将自动刷新
CronShot middleware to save images to the local filesystem
npm install cronshot-local
Install CronShot
npm install cronshot
var cronshot = require('cronshot'),
middleware = {
local: require('cronshot-local')
};
// Local File Example
// ------------------
// Takes a screenshot of sports.yahoo.com,
// and saves the screenshot to the local file system
// Save Local File Example
cronshot.startCapturing({
'url': 'http://sports.yahoo.com',
'path': __dirname,
'cronPattern': false,
'saveMiddleware': [middleware.local],
}, function(err) {
// optional callback function once all screenshots have been taken
if (err) {
console.error(err);
}
});
{
// The path where the screenshot will be saved
'path': '',
// The image name used to save the screenshot
'imageName': ''
}
Please send all PR's to the dev
branch.
If your PR is a code change:
npm install
src/modules
directory.tests/unit/cronshot-local.js
.npm test
.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。