A python wrapper for the NodeJS module 'Pageres'. I had tried a few different python screenshot modules and could not find one that 'just worked'.
from Modules.webshot import Webshot
urlArray = ["https://github.com", "https://www.stackoverflow.com"]
screenshot = Webshot()
screenshot.configure("/path/to/nodejs/pageres")
for url in urlArray:
screenshot.capture(url)
from Modules.webshot import Webshot
urlArray = ["https://github.com", "https://www.stackoverflow.com"]
screenshot = Webshot()
screenshot.configure("/path/to/nodejs/pageres")
screenshot.capture(urlArray)
from Modules.webshot import Webshot
urlArray = ["https://github.com", "https://www.stackoverflow.com"]
imageSizeArray = ["100x200","1920x1080"]
screenshot = Webshot()
screenshot.configure("/path/to/nodejs/pageres", size=imageSizeArray, crop=True, imageFormat="jpg")
screenshot.capture(urlArray)
0.50
Webshot has the following requirements:
Use pip:
pip install Webshot
git clone https://github.com/rpunnett/Webshot.git
cd Webshot-<version>
python setup.py install
- Get node binary (node.exe) from http://nodejs.org/download/
- Create the folder where node will reside and move node.exe to it
- Download the last zip version of npm from https://registry.npmjs.org/npm/-/npm-{version}.tgz.
- Unpack the zip inside the node folder
- Download the last tgz version of npm from http://nodejs.org/dist/npm
- Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
- Add the the node folder and the packages/bin folder to PATH
- On a command prompt execute npm install -g npm to update npm to the latest version
- Git must be installed and in the system PATH
https://sourceforge.net/projects/nodejsportable/ https://github.com/inexor-game-obsolete/platform/tree/master/bin/windows
npm install --global pageres-cli
MIT