Error while generating request token token using python

Dear Zerodha

I am aware that exchange mandated that we have to login manually at least once even if we use Algo. I use to login at least 5 times to track my positions once Algo place the orders. (I hope I am following exchange guidelines)

But, I am unable manage every day to create a access token manually and pass it to Algo before market open so I want my code to do that :)

Coming to the error.
I am using automated way to generate access token for whole day. But, after TOTP enters , out of 5 days at least 1 day I am redirecting to logout URL instead of request token URL

Error : URL is

Below is the code

authkey = pyotp.TOTP(totp_key)
totp.send_keys("After TOTP Enters")
continue_btn = WebDriverWait(driver, 10).until(lambda x: x.find_element("xpath",'//*[@id="container"]/div/div/div[2]/form/div[3]/button'))


url = driver.current_url"URL is %s : ", url) -------> Here it is once in a week coming as

May I know what is the issue and why it is happening intermittently ?

Sign In or Register to comment.