Client not working today. change in web portal ?

samirkelekar
My python client has been working fine for last two years. Today it stopped working.
Code and error is given. Has there been any change in the web portal ? Please help
global total
api_key="abr4teunpo6czy23"
api_secret="dnqhuv91lf2jb941bd59tr74wuz75clw"
kite= KiteConnect(api_key=api_key)
ur = kite.login_url()
print("kite.login_url is")
print(ur)
options = Options()
#options.headless = True
driver = webdriver.Firefox(options=options)
driver.get(ur)
time.sleep(5)
element = driver.find_element(By.ID, "userid")
element.send_keys("TW7385")
element = driver.find_element(By.ID,"password")
element.send_keys("123456789")
element = driver.find_element(By.CLASS_NAME, "button-orange")
element.click()
time.sleep(5)
otp = input("enter one time password")
element = driver.find_element(By.XPATH, "//input[@label='External TOTP']")
element.send_keys(otp)
element = driver.find_element(By.CLASS_NAME, "button-orange")
element.click()
time.sleep(5)
get_url=driver.current_url
print("current url is")enter one time password924796

Traceback (most recent call last):
File "populate_combined.py", line 192, in
element = driver.find_element(By.XPATH, "//input[@label='External TOTP']")
File "/home/samir/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 742, in find_element
return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
File "/home/samir/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
self.error_handler.check_response(response)
File "/home/samir/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //input[@label='External TOTP']; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:511:5
dom.find/</<@chrome://remote/content/shared/DOM.sys.mjs:136:16

print(get_url)

  • sujith
    It looks like you are automating login. As per regulations, it is mandatory to login manually at least once a day. We don't recommend automating login.
  • samirkelekar
    I dont understand. I have been doing it all along. Have the rules changed now? Also, cant one trade automatically?
    i am logging on to trade automatically. Is it possible to login manually and then trade automatically? And what do you mean "mandary login manually at least once a day" ? Rest of the time one can login automatically ?
  • samirkelekar
    Also, I need to put in password manually to login. That part is not automatic.
Sign In or Register to comment.