Create an automator document. While testing, make it a workflow. Once you've got it working the way you like, you can make an application or whatever is most useful.
Add two actions, both from the Internet category:
- Get specified URLs
- Download URLs
With the first action, click the expand triangle and if there is a default URL in there, select it and click Remove
and then Add
your specific URL.
With the second action, click the Where dropdown and choose a destination. Click 'other' to choose an arbitrary location. It might be worthwhile to have an exclusive folder specified as then you could easily run other actions on the 'contents' of the folder (see below).
Then click 'Run' to test the workflow. It should download the html for the page (but not all of the ancillary files) and save it in the specified location. If it already exists, it will save an additional copy.
This is probably the easiest method to download a web page and doesn't require that Safari actually open the page. You could also use applescript or you could use a command-line tool like wget or curl and run it from the terminal.
Update:
To make this into an app rather than a workflow, it's probably easiest to simply create a new app and then add the actions the same way that the workflow was created. Unfortunately, the file > convert to…
menu command doesn't seem very effective.
As to renaming the resulting file, unfortunately the download urls
action doesn't seem to work as it might as it does not provide a result (ie a reference to the saved html).
You can add a workaround though. Here is one that uses the saved file (so you have to download the file so you can then 'choose' it) and then renames that — note that you can then remove/trash that initial file as you only need it long enough to add the entry to the action. I use the 'add date or time' option in the 'rename finder items' action because it doesn't require user interaction but you can go through the various options and choose the best for your need.
Get specified finder items
This uses add
to specify the file so you must have a file in the download location with the correct name and then choose it (eg 'text-mode-web-browsers.html'). This is the name that the two-step download would generate based on your supplied url. Run it again with the actual url to get the correct file name for that url. Note, you don't need the actual file, just the actual file name, so you could also just stick a random text file there and give it the same name and then trash it.
Rename finder items: add date or time
You can choose your renaming options for this action but
the date/time one is easy to work with. Note that some rename options seem to function only in a workflow.