I am trying to design a python bot for fetching my attendance records from my university student portal. This is the code I have written.
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
usernameStr = '<uid>'
passwordStr = '<password>'
browser = webdriver.Chrome('D:/SOFTWARES/Chrome Driver/chromedriver.exe')
browser.get(('https://uims.cuchd.in/uims/'))
username = browser.find_element_by_xpath('/html/body/form/div[3]/div/div/div[2]/div/input[1]')
username.send_keys(usernameStr)
nextBtn = browser.find_element_by_xpath('/html/body/form/div[3]/div/div/div[2]/div/input[2]')
nextBtn.click()
password = browser.find_element_by_xpath('/html/body/form/div[3]/div/div/div[2]/div/input[1]')
password.send_keys(passwordStr)
loginBtn=browser.find_element_by_xpath('/html/body/form/div[3]/div/div/div[2]/div/input[2]')
loginBtn.click()
hamburgerBtn=browser.find_element_by_xpath('/html/body/form/div[4]/header/div[1]/div/span[2]')
hamburgerBtn.click()
# this gives error
academicBtn = browser.find_element_by_xpath("/html/body/form/div[4]/div[1]/div/div[1]/ul/ul[1]")
academicBtn.click()
I am able to successfully login but I get stuck when I have to click an element in element drawer. It shows this
error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
I went through this answer and changed my code to:
academicbutton = browser.find_element_by_xpath("/html/body/form/div[4]/div[1]/div/div[1]/ul/ul[1]")
browser.implicitly_wait(10)
ActionChains(browser).move_to_element(academicbutton).click(academicbutton).perform()
It shows this error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable: [object HTMLUListElement] has no size and location
This is the (academics)button I want to click.
I do not know web development. So I can't figure out if there is something different about the element I want to click.
EDIT: I am trying to attach code for the button I want to click from inspect window.
<li data-toggle="collapse" data-target="#3563" class="active collapsed" aria-expanded="false">
<a href="javascript:void(0);" class="a-uims-nav">
<i></i>
" Academics "
<span class="arrow">
::before
</span>
</a>
</li>