Webarchive or PDF of Webpage

Is there a way using Webview to run some javascript on the webpage (which I know how to do) but then save the webpage as either a pdf or a webarchive?

The Make PDF action should be able to do this. Just give it the Safari Web Page as input.

I can’t see any information on it in the Scriptable documentation. Can you point me to the right page?

I think he means the Shortcut action by that name, not something specific to Scriptable.

I don’t think that’s an option for me given I want to run some JavaScript on the webpage and don’t want to use the share sheet.

I’m sorry, I haven’t looked at the tags and assumed that you’re writing about Shortcuts.

One way I can think of would be to copy the current HTML structure, then switch to Shortcuts, render that HTML and make a PDF from it… The only way I can think of that this fails is if the page displays blobs… But otherwise it should load any external resources…

OK thanks. Will try that.