I'm trying to automate a login on a popular website. This website uses Discord oauth.
I have gotten to the stage where I have monitored the requests being made to discord (which contains the sites call-back URL.
However, the issue I am facing is that Discord's authorize button doesn't return the oauth code via requests. Instead when the button is clicked there is some obfuscated JS file which redirects the user to the oauth call-back URL with a generated code.
Unfortunately I do not know of a way to get this code since it cannot be monitored in network tab.
Is there a way I can get around this? For example initializing the JS file (Simulating that I clicked the authorize button in some way or another?)
I know I could use selenium, but selenium isn't great for performance, as well as websites constantly changing UI. Api endpoints are a much better way of doing it.
I'm using python httpx module.
An example login URL for this is: https://discord.com/oauth2/authorize?client_id=896549597550358548&redirect_uri=https://www.monkeebot.xyz/oauth/discord&response_type=code&scope=identify%20guilds
when you click authorize
it sends you via a callbackURL to the site on question. The goal is to automate logging in via this link by using python requests only.