Any method to get the access code with Python instead of doing it manually with the URL?

Hi,
I’m using this URL to login and get the access code:

url = f"https://api.upstox.com/v2/login/authorization/dialog?response_type=code&client_id={UPSTOX_API_KEY}&redirect_uri={redirect}"

And then using this code to get the access token:

url = “https://api.upstox.com/v2/login/authorization/token
payload={}
headers = {
‘Content-Type’: ‘application/x-www-form-urlencoded’,
‘Accept’: ‘application/json’
}
params = {
“code”: “{access code}”,
“client_id”: f"{UPSTOX_API_KEY}“,
“client_secret”: f”{UPSTOX_API_SECRET}“,
“redirect_uri”: f”{redirect}",
“grant_type”: “authorization_code”
}
response = requests.post(url, headers=headers, params=params).json()
access_token = response[‘access_token’]
print(access_token)

Is there any method using which I can get the access code without having to manually login every day?

Upstox API does not support or recommend automating access token generation in light of SEBI and regulatory guidelines. Users are required to log in manually once daily by adhering to the specified login procedures.

Thank you.