Calling Screencapture of a Web Page in AppleScript
Whenever I can I usually try to only use AppleScript and shell script but every now and then I find a hidden gem in Automator. I simply created a new Automator workflow and added three actions to it... "Get Current Webpage From Safari","Get Contents Of Webpages", and "Save Images From Web Content". 

This works for me using the latest version of macOS Mojave.



Just save the Automator workflow as an application or as a service or dictation command...etc.

For this project, my choice would be to simply save the Automator workflow in folder... /Users/YOUR SHORT NAME/Library/Scripts/Applications/Safari (if the Safari folder does not exist, you can simply create the Safari folder during the process of saving your Automator workflow) Saving the file to that location, will make it so that anytime you are using Safari, you can run the workflow from your Scripts menu bar.



If the Scripts menu is not already in your menu bar, you can enable that in the General Preferences menu of Script Editor.app