I know about a bunch of tools which claim to be able to do that. Out of curiosity I just tried all of them. I've listed the IMHO best working tools first, but YMMV:
gnome-web-photo as available in at least Debian and Ubuntu works fine and seems to be purely command-line driven despite having "gnome" in its name.
You need to pass
--mode=photo explicitly, it doesn't seem to be the default.
Works fine for my own home page, but doesn't render the given example page in a usable way (1024x8 pixels).
The perl-written Shutter is a GUI program which by default waits in your system tray for screenshot requests. But you can also use it from the command-line.
When being used from the command-line, it still open a bunch of windows, including a shortly flickering result window, even if you pass
-e on the command-line which means to exit after the screenshot has been taken.
It seems to use gnome-web-photo as a back-end, at least gnome-web-photo is a optional dependency of shutter's Debian package. The result also looks the same as with gnome-web-photo.
Unfortunately shutter uses quite a lot of memory when being used as system tray application and has quite some seconds start-up time, both, in command-line mode as well as in system tray mode.
Debian (and probably also derivatives like Ubuntu and Linux Mint) contain the two packages webkit-image-gtk and webkit-image-qt which take a screenshot of a webpage by giving a URL as parameter.
Its upstream project seems to be part of the OpenStreetMap editor Josm, but there's more information about the tool in Debian's package than ob that web page.
I just gave them a short try in Debian Unstable, but result was rather disappointing: webkit-image-qt generated a very tall and very narrow, unreadable image (195x11649 pixels) from my homepage and bailed out on the given example page without any image. And webkit-image-gtk resulted in a completely unusable image with just 1x8 pixels for both web pages. :-(