这是一个开源的网站截屏工具,可分别设置截屏的分辨率,项目放在 GitHub 上:https://github.com/sindresorhus/pagereshtml
一分钟左右就能够为十个不一样的网站截屏 100 张图了。git
安装:github
$ npm install --global pageres
用于产生截屏的 PhantomJS 会被自动安装;但在某种罕有的状况下,安装或许会失败,而后获得一个错误: Error: spawn EACCES
。若是有这个错误,手动下载 PhantomJS,而后从新安装它web
用法:npm
$ pageres --help Get screenshots of websites in different resolutions. Specify urls and screen resolutions as arguments. Order doesn't matter. Screenshots are saved in the current directory. Usage pageres <url> <resolution> [<resolution> <url> ...] pageres [<url> <resolution> ...] < <file> cat <file> | pageres [<url> <resolution> ...] Example pageres todomvc.com yeoman.io 1366x768 1600x900 pageres 1366x768 < urls.txt cat screen-resolutions.txt | pageres todomvc.com yeoman.io You can also pipe in a newline separated list of urls and screen resolutions which will get merged with the arguments. If no screen resolutions are specified it will fall back to the ten most popular ones according to w3counter.
安装:编程
$ npm install --save pageres
例子:segmentfault
var pageres = require('pageres'); pageres(['todomvc.com'], ['1366x768', '1600x900'], function () { console.log('done'); });
编译:Segmentfaultmvc