Created
June 27, 2014 09:11
-
-
Save splio-aleroux/f3e7aaedaa279d084a00 to your computer and use it in GitHub Desktop.
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
page.open(address, function (status) { | |
if (status !== 'success') { | |
console.log('Unable to load the address!'); | |
phantom.exit(); | |
} else { | |
page.evaluate(function() { | |
document.body.bgColor = 'white'; | |
}); | |
var arr = page.evaluate(function () { | |
var pageWidth = document.body.clientWidth; | |
var pageHeight = document.body.clientHeight; | |
return [pageWidth, pageHeight]; | |
}); | |
page.viewportSize = { width: arr[0], height: arr[1] }; | |
page.render(output); | |
phantom.exit(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment