This article shows how to take screenshots from Command Prompt using Chrome. You can take the screenshot of a visible portion of a webpage or the entire webpage. No extension is needed to take screenshots. Just two simple commands are all you need to execute to take webpage screenshots.
You can also select the output location or folder to save the screenshot. Using the first command, Google Chrome browser automatically takes only the portion of a webpage whose address is entered by you in the command. And, using the second command, you can specify height n width for the webpage to take its screenshot.
In the screenshot below, you can see two screenshots of a webpage captured by me using Google Chrome and Command Prompt.
Let’s check both the commands.
How to Take Screenshots from Command Prompt using Google Chrome?
Step 1: This is a basic step. You need to launch the Command Prompt window. To open that window, you can type ‘cmd‘ in Search Box of Windows or Run Command box (Windows key + r).
Step 2: Now you need to execute the command which will include:
path of Chrome browser —headless —screenshot=output location of screenshot and screenshot name along with image format “URL of webpage”.
So, the command would be: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --screenshot="C:\Users\ILOVEFREESOFTWARE\Desktop\Chromescreenshot\ilfs.png" "https://ilfsdev.inkliksites.com"
Executing this command will take only a part of the visible part of the input webpage and save it in the destination folder.
Step 3: To capture the screenshot of the full webpage, you need to enter the height n width values manually. You need to use some ruler to measure the exact height and width of webpage. You might not like this but it is the only way to capture the full screenshot. It is also beneficial when you need a webpage screenshot with height n width of your choice.
The command would be: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --headless --screenshot="C:\Users\ILOVEFREESOFTWARE\Desktop\Chromescreenshot\ilfs.png" --window-size=height,width "https://ilfsdev.inkliksites.com"
Execute the command and the full webpage will be captured and stored to the destination folder.
The Conclusion:
Using some Chrome extension to capture the full webpage is easier than executing the command. However, those who want to give it a try and don’t want to install some extension or third-party tools, this method is a nice option. Try it.