Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jabbalaci/screenshot.py
Taking a screenshot of a webpage.
https://github.com/jabbalaci/screenshot.py
phantomjs python screenshot wrapper
Last synced: 3 months ago
JSON representation
Taking a screenshot of a webpage.
- Host: GitHub
- URL: https://github.com/jabbalaci/screenshot.py
- Owner: jabbalaci
- License: mit
- Created: 2015-07-11T22:42:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-28T08:21:21.000Z (almost 9 years ago)
- Last Synced: 2024-06-29T03:34:59.805Z (5 months ago)
- Topics: phantomjs, python, screenshot, wrapper
- Language: JavaScript
- Size: 467 KB
- Stars: 49
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# screenshot.py
Taking a screenshot of a webpage.
`screenshot.py` is a wrapper script that calls `phantomjs` and `convert` to do
the real job. The advantage of `screenshot.py` is its very simple usage.### Usage
* `screenshot.py -h`
Help.
* `screenshot.py -full http://reddit.com full.jpg`
Screenshot of the entire page (can be very high).
* `screenshot.py -window http://reddit.com window.jpg`
Screenshot of the area that you see in the browser.
* `screenshot.py -thumb http://reddit.com thumb.jpg`
Thumbnail of the area that you see in the browser.
* Sometimes there is a problem with the JavaScript on the given webpage,
which can cause PhantomJS to crash :( In this case disable JS rendering
with the `--nojs` extra option. Then use the script as explained above.Example:
`screenshot.py --nojs -thumb http://buggy-js.com thumb.jpg`
### Customization
Check out the beginning of the source code. You may want to change `WIDTH`
and `THUMB_WIDTH`.### Requirements
`screenshot.py` relies on PhantomJS and the command `convert`. `convert`
is part of the ImageMagick package. See
for more information on how to install PhantomJS. We also need the
`rasterize.js` script that comes with PhantomJS. You can find a copy of it
in the `assets/` folder. I also put a customized version of the rendering
script to the `assets/` folder called `rasterize-nojs.js` that disables
JavaScript rendering on the given webpage.### Author / Links
* Laszlo Szathmary, alias Jabba Laci (), 2015
*
* reddit discussion:
* appeared in [ImportPython Weekly Newsletter - Issue No 39](http://importpython.com/newsletter/no/39/)