I am working on project where I want to pull raw data from zerodha to pandas.I am using selenium with python and facing issue while clicking toggle button which will show raw data.Please see the code below and let me know the fix for the same.
Version details:Python 3.12.1selenium 4.17.2
Zerodha Source code of toggle button:
<cq-toggle class="ciq-DT tableview-ui" cq-member="tableView"><span></span><cq-tooltip>Table View</cq-tooltip></cq-toggle>Python Code:
opts = Options()#opts.set_headless()#assert opts.headless # Operating in headless modebrowser = Firefox(options=opts)browser.implicitly_wait(3)browser.get('https://kite.zerodha.com')url_old=browser.find_element(By.ID,value='userid')url_old.send_keys('XXXXXX')url_old=browser.find_element(By.ID,value='password')url_old.send_keys('XXXXX')url_old.submit()time.sleep(10)browser.get('https://kite.zerodha.com/chart/ext/ciq/BSE/SBIN/128028676')time.sleep(10)#element=browser.find_element(By.ID,value='tableview-ui')browser.find_element(By.TAG_NAME,value='ciq-DT tableview-ui').click()Let me know if any additional information is needed.
I tried using class "ciq-DT tableview-ui" with help of findElement to location toggle button and facing below exception :
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: ciq-DT tableview-ui;I also tried to identify element By.Class, By.ID, By.XPath & By.CSS_SELECTOR and had no luck.