{"id":13534598,"url":"https://github.com/maaaaz/webscreenshot","last_synced_at":"2025-12-25T05:48:52.604Z","repository":{"id":13164794,"uuid":"15847730","full_name":"maaaaz/webscreenshot","owner":"maaaaz","description":"A simple script to screenshot a list of websites","archived":false,"fork":false,"pushed_at":"2020-10-01T16:54:52.000Z","size":11165,"stargazers_count":655,"open_issues_count":13,"forks_count":163,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-01T18:47:51.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maaaaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-12T18:16:40.000Z","updated_at":"2024-09-17T20:25:20.000Z","dependencies_parsed_at":"2022-08-30T07:12:00.078Z","dependency_job_id":null,"html_url":"https://github.com/maaaaz/webscreenshot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fwebscreenshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fwebscreenshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fwebscreenshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maaaaz%2Fwebscreenshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maaaaz","download_url":"https://codeload.github.com/maaaaz/webscreenshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222784453,"owners_count":17037192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T08:00:31.058Z","updated_at":"2025-12-25T05:48:52.594Z","avatar_url":"https://github.com/maaaaz.png","language":"Python","readme":"webscreenshot\n=============\n\nDescription\n-----------\nA simple script to screenshot a list of websites, based on the [`url-to-image`](https://github.com/kimmobrunfeldt/url-to-image/) PhantomJS script.\n\nFeatures\n--------\n* Integrating url-to-image *'lazy-rendering'* for AJAX resources\n* Fully functional on Windows and Linux systems\n* Cookie and custom HTTP header definition support for the PhantomJS renderer\n* Multiprocessing and killing of unresponding processes after a user-definable timeout\n* Accepting several formats as input target\n* Customizing screenshot size (width, height), format and quality\n* Mapping useful options of PhantomJS such as ignoring ssl error, proxy definition and proxy authentication, HTTP Basic Authentication\n* Supports multiple renderers: \n  * **PhantomJS**, which is legacy and [abandoned](https://groups.google.com/forum/#!topic/phantomjs/9aI5d-LDuNE) but the one still producing the best results\n  * **Chromium, Chrome and Edge 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.  \n    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.\n  * **Firefox** can also be used as a renderer but has some serious limitations (_so don't use it for the moment_):\n    * Impossibility to perform multiple screenshots at the time: no multi-instance of the firefox process\n    * No incognito mode, using webscreenshot will pollute your browsing history\n* Embedding screenshot URL in image (requires `ImageMagick`) \n\nUsage\n-----\nPut 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.  \nScreenshots will be available, by default, in your current ```./screenshots/``` directory.  \nAccepted input formats are the following:\n```\nhttp(s)://domain_or_ip:port(/resource)\ndomain_or_ip:port(/resource)\ndomain_or_ip(/resource)\n```\n\n### Options\n```\nwebscreenshot.py version 2.96\n\nusage: webscreenshot [-h] [-i INPUT_FILE] [-o OUTPUT_DIRECTORY] [-w WORKERS] [-v] [--no-error-file] [-z SINGLE_OUTPUT_FILE] [-p PORT]\n                     [-s] [-m] [-r {phantomjs,chrome,chromium,edge,firefox}] [--renderer-binary RENDERER_BINARY] [--no-xserver]\n                     [--window-size WINDOW_SIZE] [-f {pdf,png,jpg,jpeg,bmp,ppm}] [-q [0-100]] [--ajax-max-timeouts AJAX_MAX_TIMEOUTS]\n                     [--crop CROP] [--custom-js CUSTOM_JS] [-l] [--label-size LABEL_SIZE] [--label-bg-color LABEL_BG_COLOR]\n                     [--imagemagick-binary IMAGEMAGICK_BINARY] [-c COOKIE] [-a HEADER] [-u HTTP_USERNAME] [-b HTTP_PASSWORD]\n                     [-P PROXY] [-A PROXY_AUTH] [-T PROXY_TYPE] [-t TIMEOUT]\n                     [URL]\n\noptions:\n  -h, --help            show this help message and exit\n\nMain parameters:\n  URL                   Single URL target given as a positional argument\n  -i, --input-file INPUT_FILE\n                        \u003cINPUT_FILE\u003e text file containing the target list. Ex: list.txt\n  -o, --output-directory OUTPUT_DIRECTORY\n                        \u003cOUTPUT_DIRECTORY\u003e (optional): screenshots output directory (default './screenshots/')\n  -w, --workers WORKERS\n                        \u003cWORKERS\u003e (optional): number of parallel execution workers (default 4)\n  -v, --verbosity       \u003cVERBOSITY\u003e (optional): verbosity level, repeat it to increase the level { -v INFO, -vv DEBUG } (default\n                        verbosity ERROR)\n  --no-error-file       \u003cNO_ERROR_FILE\u003e (optional): do not write a file with the list of URL of failed screenshots (default false)\n  -z, --single-output-file SINGLE_OUTPUT_FILE\n                        \u003cSINGLE_OUTPUT_FILE\u003e (optional): name of a file which will be the single output of all inputs. Ex. test.png\n\nInput processing parameters:\n  -p, --port PORT       \u003cPORT\u003e (optional): use the specified port for each target in the input list. Ex: -p 80\n  -s, --ssl             \u003cSSL\u003e (optional): enforce SSL/TLS for every connection\n  -m, --multiprotocol   \u003cMULTIPROTOCOL\u003e (optional): perform screenshots over HTTP and HTTPS for each target\n\nScreenshot renderer parameters:\n  -r, --renderer {phantomjs,chrome,chromium,edge,firefox}\n                        \u003cRENDERER\u003e (optional): renderer to use among 'phantomjs' (legacy but best results), 'chrome', 'chromium',\n                        'edge', 'firefox' (version \u003e 57) (default 'phantomjs')\n  --renderer-binary RENDERER_BINARY\n                        \u003cRENDERER_BINARY\u003e (optional): path to the renderer executable if it cannot be found in $PATH\n  --no-xserver          \u003cNO_X_SERVER\u003e (optional): if you are running without an X server, will use xvfb-run to execute the renderer\n                        (by default, trying to detect if DISPLAY environment variable exists\n\nScreenshot image parameters:\n  --window-size WINDOW_SIZE\n                        \u003cWINDOW_SIZE\u003e (optional): width and height of the screen capture (default '1200,800')\n  -f, --format {pdf,png,jpg,jpeg,bmp,ppm}\n                        \u003cFORMAT\u003e (optional, phantomjs only): specify an output image file format, \"pdf\", \"png\", \"jpg\", \"jpeg\", \"bmp\"\n                        or \"ppm\" (default 'png')\n  -q, --quality [0-100]\n                        \u003cQUALITY\u003e (optional, phantomjs only): specify the output image quality, an integer between 0 and 100 (default\n                        75)\n  --ajax-max-timeouts AJAX_MAX_TIMEOUTS\n                        \u003cAJAX_MAX_TIMEOUTS\u003e (optional, phantomjs only): per AJAX request, and max URL timeout in milliseconds\n                        (default '1400,1800')\n  --crop CROP           \u003cCROP\u003e (optional, phantomjs only): rectangle \u003ct,l,w,h\u003e to crop the screen capture to (default to WINDOW_SIZE:\n                        '0,0,w,h'), only numbers, w(idth) and h(eight). Ex. \"10,20,w,h\"\n  --custom-js CUSTOM_JS\n                        \u003cCUSTOM_JS\u003e (optional, phantomjs only): path of a file containing JavaScript code to be executed before\n                        taking the screenshot. Ex: js.txt\n\nScreenshot label parameters:\n  -l, --label           \u003cLABEL\u003e (optional): for each screenshot, create another one displaying inside the target URL (requires\n                        imagemagick)\n  --label-size LABEL_SIZE\n                        \u003cLABEL_SIZE\u003e (optional): font size for the label (default 60)\n  --label-bg-color LABEL_BG_COLOR\n                        \u003cLABEL_BACKGROUND_COLOR\u003e (optional): label imagemagick background color (default NavajoWhite)\n  --imagemagick-binary IMAGEMAGICK_BINARY\n                        \u003cLABEL_BINARY\u003e (optional): path to the imagemagick binary (magick or convert) if it cannot be found in $PATH\n\nHTTP parameters:\n  -c, --cookie COOKIE   \u003cCOOKIE_STRING\u003e (optional): cookie string to add. Ex: -c \"JSESSIONID=1234; YOLO=SWAG\"\n  -a, --header HEADER   \u003cHEADER\u003e (optional): custom or additional header. Repeat this option for every header. Ex: -a \"Host:\n                        localhost\" -a \"Foo: bar\"\n  -u, --http-username HTTP_USERNAME\n                        \u003cHTTP_USERNAME\u003e (optional): specify a username for HTTP Basic Authentication.\n  -b, --http-password HTTP_PASSWORD\n                        \u003cHTTP_PASSWORD\u003e (optional): specify a password for HTTP Basic Authentication.\n\nConnection parameters:\n  -P, --proxy PROXY     \u003cPROXY\u003e (optional): specify a proxy. Ex: -P http://proxy.company.com:8080\n  -A, --proxy-auth PROXY_AUTH\n                        \u003cPROXY_AUTH\u003e (optional): provides authentication information for the proxy. Ex: -A user:password\n  -T, --proxy-type PROXY_TYPE\n                        \u003cPROXY_TYPE\u003e (optional): specifies the proxy type, \"http\" (default), \"none\" (disable completely), or\n                        \"socks5\". Ex: -T socks\n  -t, --timeout TIMEOUT\n                        \u003cTIMEOUT\u003e (optional): renderer execution timeout in seconds (default 30 sec)\n```\n\n### Examples\n```\nlist.txt\n--------\nhttp://google.fr\nhttps://216.58.213.131\n216.58.213.131\nhttps://duckduckgo.com/robots.txt\n\n\nDefault execution with a list\n-----------------------------\n$ python webscreenshot.py -i list.txt\nwebscreenshot.py version 2.3\n\n[+] 4 URLs to be screenshot\n[+] 4 actual URLs screenshot\n[+] 0 error(s)\n\n\nDefault execution with a single URL\n-----------------------------------\n$ python webscreenshot.py -v google.fr\nwebscreenshot.py version 2.3\n\n[INFO][General] 'google.fr' has been formatted as 'http://google.fr:80' with supplied overriding options\n[+] 1 URLs to be screenshot\n[INFO][http://google.fr:80] Screenshot OK\n\n[+] 1 actual URLs screenshot\n[+] 0 error(s)\n\n\nIncreasing verbosity level execution\n-----------------------------------\n$ python webscreenshot.py -i list.txt -v\nwebscreenshot.py version 2.3\n\n[INFO][General] 'http://google.fr' has been formatted as 'http://google.fr:80' with supplied overriding options\n[INFO][General] 'https://216.58.213.131' has been formatted as 'https://216.58.213.131:443' with supplied overriding options\n[INFO][General] '216.58.213.131' has been formatted as 'http://216.58.213.131:80' with supplied overriding options\n[INFO][General] 'https://duckduckgo.com/robots.txt' has been formatted as 'https://duckduckgo.com:443/robots.txt' with supplied overriding options\n[+] 4 URLs to be screenshot\n[INFO][https://duckduckgo.com:443/robots.txt] Screenshot OK\n\n[INFO][http://216.58.213.131:80] Screenshot OK\n\n[INFO][https://216.58.213.131:443] Screenshot OK\n\n[INFO][http://google.fr:80] Screenshot OK\n\n[+] 4 actual URLs screenshot\n[+] 0 error(s)\n\n\nResults\n-------\n$ ls -l screenshots/\ntotal 187\n-rwxrwxrwx 1 root root 53805 May 19 16:04 http_216.58.213.131_80.png\n-rwxrwxrwx 1 root root 53805 May 19 16:05 http_google.fr_80.png\n-rwxrwxrwx 1 root root 53805 May 19 16:04 https_216.58.213.131_443.png\n-rwxrwxrwx 1 root root 27864 May 19 16:04 https_duckduckgo.com_443_robots.txt.png\n```\n  \n\n### Supported options by renderers\nOptions not listed here below are supported by every current renderer  \n\n| **Option category**   | **Option**                                                                   | **PhantomJS renderer** | **Chromium / Chrome / Edge Chromium renderer** | **Firefox renderer** |\n|:---------------------:|------------------------------------------------------------------------------|:----------------------:|:------------------------------:|:--------------------:|\n| **Screenshot parameters**   |                                                                              |                        |                                |                      |\n|                       | format (`-f`)                                                                  | [**Yes**](https://web.archive.org/web/20200111184123/https://phantomjs.org/api/webpage/method/render.html)                    | No                             | No                   |\n|                       | quality (`-q`)                                                                  | [**Yes**](https://web.archive.org/web/20200111184123/https://phantomjs.org/api/webpage/method/render.html)                    | No                             | No                   \n|                       | ajax and request timeouts (`--ajax-max-timeouts`)                                         | **Yes**                    | No                             | No                   \n|                       | crop (`--crop`)                                                                  | [**Yes**](https://web.archive.org/web/20200111184050/https://phantomjs.org/api/webpage/property/clip-rect.html)                    | No                             | No                   \n|                       | custom JavaScript (`--custom-js`)                                                                  | [**Yes**](https://web.archive.org/web/20200823123026/https://phantomjs.org/api/webpage/method/evaluate-java-script.html)                    | No                             | No                   \n|                       |                                                                              |                        |                                |                      |\n| **HTTP parameters**   |                                                                              |                        |                                |                      |\n|                       | cookie (`-c`)                                                                  | **Yes**                    | No                             | No                   |\n|                       | header (`-a`)                                                                  | **Yes**                    | No                             | No                   |\n|                       | http_username (`-u`)                                                           | **Yes**                    | No                             | No                   |\n|                       | http_password (`-b`)                                                           | **Yes**                    | No                             | No                   |\n|                       |                                                                              |                        |                                |                      |\n| **Connection parameters** |                                                                              |                        |                                |                      |\n|                       | proxy (`-P`)                                                                   | **Yes**                    | **Yes**                            | No                   |\n|                       | proxy_auth (`-A`)                                                              | **Yes**                    | No                             | No                   |\n|                       | proxy_type (`-T`)                                                              | **Yes**                    | [**Yes**](https://github.com/maaaaz/webscreenshot/pull/51)                             | No                   |\n|                       |                                                                              |                        |                                |                      |\n|                       | Ability to screenshot a HTTPS website with a non-publicly-signed certificate | **Yes**                    | No                             | No                   |\n  \n  \nRequirements\n------------\n* A Python interpreter with version 2.7 or 3.X\n* The webscreenshot python script: \n  * The **easiest way** to setup it: `pip install webscreenshot` and then directly use `$ webscreenshot` \n  * Or git clone that repository and `pip install -r requirements.txt` and then `python webscreenshot.py`\n* The PhantomJS tool with at least version 2: follow the [installation guide](https://github.com/maaaaz/webscreenshot/wiki/Phantomjs-installation) and check the [FAQ](https://github.com/maaaaz/webscreenshot/wiki/FAQ) if necessary\n* Chrome, Chromium or Firefox \u003e 57 if you want to use one of these renderers\n* `xvfb` if you want to run `webscreenshot` in an headless OS: use the `--no-xserver` webscreenshot option to ease everything\n* `ImageMagick` binary (`magick` or `convert`) if you want to embed URL in screenshots with the `--label` option: follow the [installation guide](https://github.com/maaaaz/webscreenshot/wiki/ImageMagick-installation)\n* Check the [FAQ](https://github.com/maaaaz/webscreenshot/wiki/FAQ) before reporting issues\n  \n\nChangelog\n---------\n* version 2.96/2.97 - 10/19/2025: Dropping Python v2\n* version 2.95 - 10/18/2025: Fixing phantomjs bug when not finding OpenSSL configuration\n* version 2.94 - 08/23/2020: Added custom-js and single output file options\n* version 2.93 - 08/16/2020: Added support of Python 3.8 and Microsoft Edge Chromium ; file output for failed webscreenshots ; filename length limitation for long URL \n* version 2.92 - 06/21/2020: no_xserver option autodetection\n* version 2.91 - 05/08/2020: Multiprotocol mode fix\n* version 2.9 - 01/26/2020: Few fixes\n* version 2.8 - 01/11/2020: Few fixes, ajax timeouts + crop + label size + label font options added, default values for ajaxTimeout and maxTimeout changed \n* version 2.7 - 01/04/2020: URL embedding in screenshot option added\n* version 2.6 - 12/27/2019: Few fixes\n* version 2.5 - 09/22/2019: Image quality and format options added, PhantomJS useragent updated, modern TLD support\n* version 2.4 - 05/30/2019: Few fixes for Windows support\n* version 2.3 - 05/19/2019: Python 3 compatibility, Firefox renderer added, no-xserver option added\n* version 2.2 - 08/13/2018: Chrome and Chromium renderers support and single URL support\n* version 2.1 - 01/14/2018: Multiprotocol option addition and PyPI packaging\n* version 2.0 - 03/08/2017: Adding proxy-type option\n* version 1.9 - 01/10/2017: Using ALL SSL/TLS ciphers\n* version 1.8 - 07/05/2015: Option groups definition\n* version 1.7 - 06/28/2015: HTTP basic authentication support + loglevel option changed to verbosity\n* version 1.6 - 04/23/2015: Transparent background fix\n* version 1.5 - 01/11/2015: Cookie and custom HTTP header support\n* version 1.4 - 10/12/2014: url-to-image PhantomJS script integration + few bugs corrected\n* version 1.3 - 08/05/2014: Windows support + few bugs corrected\n* version 1.2 - 04/27/2014: Few bugs corrected\n* version 1.1 - 04/21/2014: Changed the script to use PhantomJS instead of the buggy wkhtml binary \n* version 1.0 - 01/12/2014: Initial commit\n\nCopyright and license\n---------------------\nwebscreenshot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nwebscreenshot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  \n\nSee the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with webscreenshot. \nIf not, see http://www.gnu.org/licenses/.\n\nContact\n-------\n* Thomas Debize \u003c tdebize at mail d0t com \u003e","funding_links":[],"categories":["Tools","Open Sources Intelligence (OSINT)","Python","Python (1887)","Uncategorized","Web Exploitation","Testing Methodology:"],"sub_categories":["Web Exploitation","Web application and resource analysis tools","Uncategorized","Penetration Testing Report Templates","Where To Look:"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaaaaz%2Fwebscreenshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaaaaz%2Fwebscreenshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaaaaz%2Fwebscreenshot/lists"}