Slightly hacky alternate solution, but its saved me a few times(in other situations) and its worth considering as an alternative. YMMV, and its a little crunchy - but you run a browser that's usable over SSH on the pi. I'm running the binary versions not the docker container.
Its a simple download and unzip, I vaguely recall there was a prerequisite it needed, and once you're done you can just remove it.
Running it is as simple as ./carbonyl - there may be a prompt asking you to run it with a argument for no sandbox on some versions of linux. This appears permissions related, potentially due to apparmor. You can find steps to work around that in my question here
In theory you can use w3m in some cases, but carbonyl has much better support for the modern web.
I need to dig up the password for my router, and I can't promise to how usable it'll be but I've gotten as far as the login page for it
