Screenshots On Linux Command Line(Chromium)
In order to get a screenshot of a web page(URL) in Chromium, we use this simple syntax structure in our terminal:
[path/to/chromium] --headless --screenshot="[path/to/save/filename.png]" "[URL]"
If you need to find your path to chromium install, use which command like this:
$ which chromium-browser
/usr/bin/chromium-browser
With that bit of information, we can now execute our screenshot command
$ /usr/bin/chromium-browser --headless --screenshot="/home/owl/Pictures/screenshot.png" "https://owlasylum.net"
This only screenshots “above the fold” area. Control screen capture size with --window-size
option. Set width to be 1920 pixels (full HD) and height to 3000 pixels. With --hide-scrollbars
option, hide scrollbars for more succinct capture.
/usr/bin/chromium-browser --headless --hide-scrollbars --window-size=1920,3000 --screenshot="/home/owl/Pictures/screenshot.png" "https://owlasylum.net"