-
-
Save sundisee/8222c0c4b954b51c1a4599ce16d4711c to your computer and use it in GitHub Desktop.
phantomjs批量截取网页某一区域脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var base = 'http://dev.kaid.me/c'; | |
var ids = [1, 2, 3, 41, 42, 43, 51, 52, 53]; | |
ids.forEach(function(id) { | |
var page = require('webpage').create(), | |
url = base + id, | |
output = 'c' + id + '.png'; | |
page.clipRect = {top:122, left:65, width:360, height:600}; | |
page.open(url, function (status) { | |
window.setTimeout(function() { | |
var result = page.render(output); | |
}, 4000) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment