Hi Alyb,
I guess it will be easier to use the Translate Shell script, which supports DeepL. Read the docs on Github, it has stuff like dictionary mode and alternate translations (not sure if also for DeepL, but I think so).
If Translate Shell does what you want, then it’s just a matter of grabbing the shell output, which will probably be more straightforward than getting it from the web page. (The script is using the API of the transllation engine.)
I’ve already written a KM macro for Translate Shell. It does not cover the alternate translations and other modes of Translate Shell, but I’m sure you can copy some elements from the macro.
You also find some (hopefully) useful information in my macro post, e.g. how to install Translate Shell and a workaround for a bug (if the bug is still there).