var page = require('webpage').create(); var args = require('system').args; var url = args[1]; var filename = args[2]; var cliptop = args[3]; var clipleft = args[4]; var clipwidth = args[5]; var clipheight = args[6]; // letf : 0, // width : 1000, // height : 410 page.viewportSize = { width: 1000, height: 480 }; page.clipRect = { top : cliptop, left : clipleft, width : clipwidth, height : clipheight }; page.open(url, function () { window.setTimeout(function () { page.render(filename); phantom.exit(); }, 15000); });
转载于:https://blog.51cto.com/tianbin/1686342