I think you can use the Javascript for Automation from this post by @ComplexPoint :
So this process the clipboard and can return the html to a new variable, which you then can manipulate.
I have tried it with the macro below. And if I copy something from a webpage and run it, then I get HTML-code.
Keyboard Maestro 8.2.4 “Clipboard to html code” Macro
Clipboard to html.kmmacros (2.1 KB)
1 Like