Screen Capture Web Pages with JavaScript

The following JavaScript code will help you convert any web URL into a PNG image from the command line. The script renders the page using Webkit, the same engine that’s used inside Google Chrome and Apple Safari browser. See demo at ctrlq.org/screenshots.