ee.Screen allows to take screenshots of web pages according to a list of URLs. The script supports various resolutions and several formats - JPG, PDF, PNG and TXT. Also, headless mode allows to use very high resolutions, such as 5000*5000 pixels. This can be useful, for example, if you need to take a large screenshot from Google Maps.
ee.Screen uses NodeJS and Google Chrome Puppeteer. To install NodeJS, visit nodejs.org. To install Puppeteer, after NodeJS is installed, open a Windows Command Prompt and type
npm install --save puppeteer
- Unpack the downloaded archive
- Open urls.txt in a text editor and paste the URLs of the required pages instead of existing samples
- Save urls.txt, then run run.bat
- See result in \screenshots folder
The common way to use the script is to run it from the Windows Command Prompt with the path to the URL list file as an argument:
node "c:\path\to\ee.screen.js" "c:\path\to\list\file.txt"
The line has the following format:
url,width*height,output
Quotes are only needed if the field contains a comma. The order of the fields in the line does not matter. For example:
"https://news.sky.com/world",1280*1024,"D:\My files\screenshot01.jpg"
-
The
url
is the only required parameter, it must start with the prefixhttp://
orhttps://
-
To take a screenshot at full page height, replace the height value with the word
full
. If the resolution field is missed, the script uses the default1280*full
-
The
output
field specifies the folder, filename and extension. It can be specified partially, then the missing parts are replaced with default values. In this case, the part of the string to the right of the last slash is interpreted as a filename and/or extension. If the field does not contain slashes, it's fully interpreted as filename and/or extension. The folder and filename supports renaming masks*flatUrl*
,*pageTitle*
,*width*
,*height*
and custom datetime that recognizes letters YMDhms (for example,*YYYY-MM-DD hh.mm.ss*
). The extension can contain several formats, for examplejpg+pdf+png+txt
. To take PDF screenshot in landscape orientation, specify the extension aslpdf
instead ofpdf
. If theoutput
field is missing, the script uses the default\screenshots\*flatUrl*.png
To take PNG screenshot, 1280p width and full page height, save as \screenshots\https_news.sky.com_world.png:
https://news.sky.com/world
To take JPG and PDF screenshots, 1280p width and full page height, save as \20210101\https_news.sky.com_world.jpg and \20210101\https_news.sky.com_world.pdf:
https://news.sky.com/world,"*YYYYMMDD*\.jpg+pdf"
To take PNG screenshot, 1024p width and 768p height, save as D:\My files\new screenshot.png:
https://news.sky.com/world,1024*768,"D:\My files\new screenshot"
- Encoding of TXT screenshots is UTF8
- If some line of the URL list cannot be processed (due to failed parsing, non-existent url, network error, etc.), it's written to the file not_processed_YYYYMMDDhhmmss.log
- If the URLs list contains non-latin letters, it must be in Unicode (any type)
- Screenshots in PDF and TXT formats are always taken at full page height (PDF - paginated in A4 with 100% scale, TXT - in accordance with HTML markup)
- This software is free for non-commercial use and is provided 'as is' without warranty of any kind, either express or implied
- The author will not be liable for data loss, damages or any other kind of loss while using or misusing this software
- The author will not be liable for the misuse of content obtained using this software, including copyrighted, age-restricted, or any other protected content
- JavaScript
- Visual Studio Code 1.30
- Chrome Puppeteer 1.20.0
- Windows 10 Pro x64 version 1909
- Node.js 10.16.3 x64
automated batch bulk jpg list multiple pdf png screenshots snapshots text txt url webpages
Takes screenshots of web pages according to a list of URLs. Supports various resolutions and several formats - JPG, PDF, PNG and TXT