
간단한 스크립트로 웹사이트 목록을 스크린샷합니다.
웹사이트 목록을 스크린샷하는 간단한 스크립트로, url-to-image PhantomJS 스크립트를 기반으로 합니다.
--ignore-certificate-errors 옵션이 작동하지 않으며 더 이상 작동하지 않을 것이기 때문입니다. 해결책은 적절한 웹드라이버를 사용하는 것이지만, 현재까지 webscreenshot은 일부 타사 도구가 필요한 다소 복잡한 이 방법을 지원하지 않습니다.ImageMagick 필요)대상 URL을 텍스트 파일에 넣고 -i 옵션으로 전달하거나, 단일 URL만 있는 경우 위치 인수로 전달합니다.
기본적으로 스크린샷은 현재 ./screenshots/ 디렉토리에 저장됩니다.
허용되는 입력 형식은 다음과 같습니다:
http(s)://domain_or_ip:port(/resource)
domain_or_ip:port(/resource)
domain_or_ip(/resource)
webscreenshot.py version 2.96
usage: webscreenshot [-h] [-i INPUT_FILE] [-o OUTPUT_DIRECTORY] [-w WORKERS] [-v] [--no-error-file] [-z SINGLE_OUTPUT_FILE] [-p PORT]
[-s] [-m] [-r {phantomjs,chrome,chromium,edge,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] [--custom-js CUSTOM_JS] [-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]
options:
-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 <VERBOSITY> (optional): verbosity level, repeat it to increase the level { -v INFO, -vv DEBUG } (default
verbosity ERROR)
--no-error-file <NO_ERROR_FILE> (optional): do not write a file with the list of URL of failed screenshots (default false)
-z, --single-output-file SINGLE_OUTPUT_FILE
<SINGLE_OUTPUT_FILE> (optional): name of a file which will be the single output of all inputs. Ex. test.png
Input processing parameters:
-p, --port PORT <PORT> (optional): use the specified port for each target in the input list. Ex: -p 80
-s, --ssl <SSL> (optional): enforce SSL/TLS for every connection
-m, --multiprotocol <MULTIPROTOCOL> (optional): perform screenshots over HTTP and HTTPS for each target
Screenshot renderer parameters:
-r, --renderer {phantomjs,chrome,chromium,edge,firefox}
<RENDERER> (optional): renderer to use among 'phantomjs' (legacy but best results), 'chrome', 'chromium',
'edge', 'firefox' (version > 57) (default 'phantomjs')
--renderer-binary RENDERER_BINARY
<RENDERER_BINARY> (optional): path to the renderer executable if it cannot be found in $PATH
--no-xserver <NO_X_SERVER> (optional): if you are running without an X server, will use xvfb-run to execute the renderer
(by default, trying to detect if DISPLAY environment variable exists
Screenshot image parameters:
--window-size WINDOW_SIZE
<WINDOW_SIZE> (optional): width and height of the screen capture (default '1200,800')
-f, --format {pdf,png,jpg,jpeg,bmp,ppm}
<FORMAT> (optional, phantomjs only): specify an output image file format, "pdf", "png", "jpg", "jpeg", "bmp"
or "ppm" (default 'png')
-q, --quality [0-100]
<QUALITY> (optional, phantomjs only): specify the output image quality, an integer between 0 and 100 (default
75)
--ajax-max-timeouts AJAX_MAX_TIMEOUTS
<AJAX_MAX_TIMEOUTS> (optional, phantomjs only): per AJAX request, and max URL timeout in milliseconds
(default '1400,1800')
--crop CROP <CROP> (optional, phantomjs only): rectangle <t,l,w,h> 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"
--custom-js CUSTOM_JS
<CUSTOM_JS> (optional, phantomjs only): path of a file containing JavaScript code to be executed before
taking the screenshot. Ex: js.txt
Screenshot label parameters:
-l, --label <LABEL> (optional): for each screenshot, create another one displaying inside the target URL (requires
imagemagick)
--label-size LABEL_SIZE
<LABEL_SIZE> (optional): font size for the label (default 60)
--label-bg-color LABEL_BG_COLOR
<LABEL_BACKGROUND_COLOR> (optional): label imagemagick background color (default NavajoWhite)
--imagemagick-binary IMAGEMAGICK_BINARY
<LABEL_BINARY> (optional): path to the imagemagick binary (magick or convert) if it cannot be found in $PATH
HTTP parameters:
-c, --cookie COOKIE <COOKIE_STRING> (optional): cookie string to add. Ex: -c "JSESSIONID=1234; YOLO=SWAG"
-a, --header HEADER <HEADER> (optional): custom or additional header. Repeat this option for every header. Ex: -a "Host:
localhost" -a "Foo: bar"
-u, --http-username HTTP_USERNAME
<HTTP_USERNAME> (optional): specify a username for HTTP Basic Authentication.
-b, --http-password HTTP_PASSWORD
<HTTP_PASSWORD> (optional): specify a password for HTTP Basic Authentication.
Connection parameters:
-P, --proxy PROXY <PROXY> (optional): specify a proxy. Ex: -P http://proxy.company.com:8080
-A, --proxy-auth PROXY_AUTH
<PROXY_AUTH> (optional): provides authentication information for the proxy. Ex: -A user:password
-T, --proxy-type PROXY_TYPE
<PROXY_TYPE> (optional): specifies the proxy type, "http" (default), "none" (disable completely), or
"socks5". Ex: -T socks
-t, --timeout TIMEOUT
<TIMEOUT> (optional): renderer execution timeout in seconds (default 30 sec)
list.txt
--------
http://google.fr
https://216.58.213.131
216.58.213.131
https://duckduckgo.com/robots.txt
Default execution with a list
-----------------------------
$ python webscreenshot.py -i list.txt
webscreenshot.py version 2.3
[+] 4 URLs to be screenshot
[+] 4 actual URLs screenshot
[+] 0 error(s)
Default execution with a single URL
-----------------------------------
$ python webscreenshot.py -v google.fr
webscreenshot.py version 2.3
[INFO][General] 'google.fr' has been formatted as 'http://google.fr:80' with supplied overriding options
[+] 1 URLs to be screenshot
[INFO][http://google.fr:80] Screenshot OK
[+] 1 actual URLs screenshot
[+] 0 error(s)
Increasing verbosity level execution
-----------------------------------
$ python webscreenshot.py -i list.txt -v
webscreenshot.py version 2.3
[INFO][General] 'http://google.fr' has been formatted as 'http://google.fr:80' with supplied overriding options
[INFO][General] 'https://216.58.213.131' has been formatted as 'https://216.58.213.131:443' with supplied overriding options
[INFO][General] '216.58.213.131' has been formatted as 'http://216.58.213.131:80' with supplied overriding options
[INFO][General] 'https://duckduckgo.com/robots.txt' has been formatted as 'https://duckduckgo.com:443/robots.txt' with supplied overriding options
[+] 4 URLs to be screenshot
[INFO][https://duckduckgo.com:443/robots.txt] Screenshot OK
[INFO][http://216.58.213.131:80] Screenshot OK
[INFO][https://216.58.213.131:443] Screenshot OK
[INFO][http://google.fr:80] Screenshot OK
[+] 4 actual URLs screenshot
[+] 0 error(s)
Results
-------
$ ls -l screenshots/
total 187
-rwxrwxrwx 1 root root 53805 May 19 16:04 http_216.58.213.131_80.png
-rwxrwxrwx 1 root root 53805 May 19 16:05 http_google.fr_80.png
-rwxrwxrwx 1 root root 53805 May 19 16:04 https_216.58.213.131_443.png
-rwxrwxrwx 1 root root 27864 May 19 16:04 https_duckduckgo.com_443_robots.txt.png
아래 나열되지 않은 옵션은 모든 현재 렌더러에서 지원됩니다
pip install webscreenshot 후 바로 $ webscreenshot 사용pip install -r requirements.txt를 실행한 후 python webscreenshot.py를 사용webscreenshot을 실행하려면 xvfb: 모든 것을 쉽게 하기 위해 --no-xserver webscreenshot 옵션 사용--label 옵션으로 스크린샷에 URL을 포함하려면 ImageMagick 바이너리 (magick 또는 convert): 설치 가이드 참조webscreenshot은 자유 소프트웨어입니다: 자유 소프트웨어 재단(Free Software Foundation)에서 발행한 GNU 일반 공중 사용 허가서(GNU General Public License) 버전 3 또는 (선택에 따라) 이후 버전의 조건에 따라 재배포 및 수정할 수 있습니다.
webscreenshot은 유용하게 사용될 것이라는 희망으로 배포되지만, 어떠한 보증도 제공하지 않습니다. 상품성 또는 특정 목적에의 적합성에 대한 묵시적 보증도 포함되지 않습니다.
자세한 내용은 GNU 일반 공중 사용 허가서를 참조하십시오.
webscreenshot과 함께 GNU 일반 공중 사용 허가서의 사본을 받았어야 합니다. 받지 못했다면 http://www.gnu.org/licenses/를 참조하십시오.
| Option category | Option | PhantomJS renderer | Chromium / Chrome / Edge Chromium renderer | Firefox renderer |
|---|
| 스크린샷 매개변수 | ||||
형식 (-f) | 예 | 아니요 | 아니요 | |
품질 (-q) | 예 | 아니요 | 아니요 | |
ajax 및 요청 시간 제한 (--ajax-max-timeouts) | 예 | 아니요 | 아니요 | |
자르기 (--crop) | 예 | 아니요 | 아니요 | |
사용자 정의 JavaScript (--custom-js) | 예 | 아니요 | 아니요 | |
| HTTP 매개변수 | ||||
쿠키 (-c) | 예 | 아니요 | 아니요 | |
헤더 (-a) | 예 | 아니요 | 아니요 | |
http_username (-u) | 예 | 아니요 | 아니요 | |
http_password (-b) | 예 | 아니요 | 아니요 | |
| 연결 매개변수 | ||||
프록시 (-P) | 예 | 예 | 아니요 | |
proxy_auth (-A) | 예 | 아니요 | 아니요 | |
proxy_type (-T) | 예 | 예 | 아니요 | |
| 공개적으로 서명되지 않은 인증서를 사용하는 HTTPS 웹사이트를 스크린샷하는 기능 | 예 | 아니요 | 아니요 |