# webscreenshot **Repository Path**: fooballz/webscreenshot ## Basic Information - **Project Name**: webscreenshot - **Description**: https://github.com/maaaaz/webscreenshot.git - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-03-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README webscreenshot ============= Description ----------- A simple script to screenshot a list of websites, based on the [`url-to-image`](https://github.com/kimmobrunfeldt/url-to-image/) PhantomJS script. Features -------- * Integrating url-to-image *'lazy-rendering'* for AJAX resources * Fully functional on Windows and Linux systems * Cookie and custom HTTP header definition support for the PhantomJS renderer * Multiprocessing and killing of unresponding processes after a user-definable timeout * Accepting several formats as input target * Customizing screenshot size (width, height), format and quality * Mapping useful options of PhantomJS such as ignoring ssl error, proxy definition and proxy authentication, HTTP Basic Authentication * Supports multiple renderers: * **PhantomJS**, which is legacy and [abandoned](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE) but the one still producing the best results * **Chrome and Chromium**, which will replace PhantomJS but currently have some limitations: screenshoting an HTTPS website not having a valid certificate, for instance a self-signed one, will produce an empty screenshot. The reason is that the [`--ignore-certificate-errors`](https://groups.google.com/a/chromium.org/forum/#!topic/headless-dev/eiudRsYdc3A) option doesn't work and will never work anymore: the solution is to use a [proper webdriver](https://bugs.chromium.org/p/chromium/issues/detail?id=697721), but to date `webscreenshot` doesn't aim to support this _rather complex_ method requiring some third-party tools. * **Firefox** can also be used as a renderer but has some serious limitations (_so don't use it for the moment_): * Impossibility to perform multiple screenshots at the time: no multi-instance of the firefox process * No incognito mode, using webscreenshot will pollute your browsing history * Embedding screenshot URL in image (requires `ImageMagick`) Usage ----- Put your targets in a text file and pass it with the `-i` option, or as a positional argument if you have just a single URL. Screenshots will be available, by default, in your current ```./screenshots/``` directory. Accepted input formats are the following: ``` http(s)://domain_or_ip:port(/resource) domain_or_ip:port(/resource) domain_or_ip(/resource) ``` ### Options ``` webscreenshot.py version 2.8 usage: webscreenshot.py [-h] [-i INPUT_FILE] [-o OUTPUT_DIRECTORY] [-w WORKERS] [-v] [-p PORT] [-s] [-m] [-r {phantomjs,chrome,chromium,firefox}] [--renderer-binary RENDERER_BINARY] [--no-xserver] [--window-size WINDOW_SIZE] [-f {pdf,png,jpg,jpeg,bmp,ppm}] [-q [0-100]] [--ajax-max-timeouts AJAX_MAX_TIMEOUTS] [--crop CROP] [-l] [--label-size LABEL_SIZE] [--label-bg-color LABEL_BG_COLOR] [--imagemagick-binary IMAGEMAGICK_BINARY] [-c COOKIE] [-a HEADER] [-u HTTP_USERNAME] [-b HTTP_PASSWORD] [-P PROXY] [-A PROXY_AUTH] [-T PROXY_TYPE] [-t TIMEOUT] [URL] optional arguments: -h, --help show this help message and exit Main parameters: URL Single URL target given as a positional argument -i INPUT_FILE, --input-file INPUT_FILE text file containing the target list. Ex: list.txt -o OUTPUT_DIRECTORY, --output-directory OUTPUT_DIRECTORY (optional): screenshots output directory (default './screenshots/') -w WORKERS, --workers WORKERS (optional): number of parallel execution workers (default 4) -v, --verbosity (optional): verbosity level, repeat it to increase the level { -v INFO, -vv DEBUG } (default verbosity ERROR) Input processing parameters: -p PORT, --port PORT (optional): use the specified port for each target in the input list. Ex: -p 80 -s, --ssl (optional): enforce ssl for every connection -m, --multiprotocol (optional): perform screenshots over HTTP and HTTPS for each target Screenshot renderer parameters: -r {phantomjs,chrome,chromium,firefox}, --renderer {phantomjs,chrome,chromium,firefox} (optional): renderer to use among 'phantomjs' (legacy but best results), 'chrome', 'chromium', 'firefox' (version > 57) (default 'phantomjs') --renderer-binary RENDERER_BINARY (optional): path to the renderer executable if it cannot be found in $PATH --no-xserver (optional): if you are running without an X server, will use xvfb-run to execute the renderer Screenshot image parameters: --window-size WINDOW_SIZE (optional): width and height of the screen capture (default '1200,800') -f {pdf,png,jpg,jpeg,bmp,ppm}, --format {pdf,png,jpg,jpeg,bmp,ppm} (optional, phantomjs only): specify an output image file format, "pdf", "png", "jpg", "jpeg", "bmp" or "ppm" (default 'png') -q [0-100], --quality [0-100] (optional, phantomjs only): specify the output image quality, an integer between 0 and 100 (default 75) --ajax-max-timeouts AJAX_MAX_TIMEOUTS (optional, phantomjs only): per AJAX request, and max URL timeout in milliseconds (default '1400,1800') --crop CROP (optional, phantomjs only): rectangle to crop the screen capture to (default to WINDOW_SIZE: '0,0,w,h'), only numbers, w(idth) and h(eight). Ex. "10,20,w,h" Screenshot label parameters: -l, --label