If you need to do some "work" like closing banners or form filling before taking the screenshot,
use the kantu Selenium IDE: https://a9t9.com/kantu/docs/selenium-ide/capturescreenshot
Command line options: https://a9t9.com/kantu/docs#cmd
(... and it works in Chrome and Firefox.)