#Automatic login to fyers API
app_id = "Insert your API ID"
app_secret = "Insert your API secret"
app_session = accessToken.SessionModel(app_id, app_secret)
response = app_session.auth()
authorization_code = response['data']['authorization_code']
app_session.set_token(authorization_code)
url = app_session.generate_token()
driver = webdriver.Chrome("Insert the path to chrome driver")
driver.get(url)
time.sleep(5)
driver.find_element_by_xpath('//*[@id="fyers_id"]').send_keys("Insert your Client ID")
driver.find_element_by_xpath('//*[@id="password"]').send_keys("Insert your Password")
driver.find_element_by_xpath('//*[@id="pancard"]').send_keys("Insert your PAN number")
driver.find_element_by_xpath('//*[@id="btn_id"]').click()
time.sleep(10)
token=driver.current_url[36:]
is_async = False #(By default False, Change to True for asnyc API calls.)
fyers = fyersModel.FyersModel(is_async)
driver.quit()
I use this code for an automated login using python. It primarily uses selenium to do the work. Does anyone have a better methodology?