I am trying to create a Python program that periodically checks a website for a specific update. The site is secured and multiple clicks are required to get to the page that I want to monitor. Unfortunately, I am stuck trying to figure out how to click a specific button. Here is the button code:
<input type="button" class="bluebutton" name="manageAptm" value="Manage Interview Appointment" onclick="javascript:programAction('existingApplication', '0');">
I have tried numerous ways to access the button and always get "selenium.common.exceptions.NoSuchElementException:" error. The obvious approach to access the button is XPath and using the Chrome X-Path Helper tool, I get the following:
/html/body/form/table[@class='appgridbg mainContent']/tbody/tr/td[2]/div[@class='maincontainer']/div[@class='appcontent'][1]/table[@class='colorgrid']/tbody/tr[@class='gridItem']/td[6]/input[@class='bluebutton']
If I include the above as follows:
browser.find_element_by_xpath("/html/body/form/table[@class='appgridbg mainContent']/tbody/tr/td[2]/div[@class='maincontainer']/div[@class='appcontent'][1]/table[@class='colorgrid']/tbody/tr[@class='gridItem']/td[6]/input[@class='bluebutton']").submit()
I still get the NoSuchElementException error.
I am new to selenium and so there could be something obvious that I am missing; however, after much Googling, I have not found an obvious solution.
On another note, I have also tried find_element_by_name('manageAptm') and find_element_by_class_name('bluebutton') and both give the same error.
Can someone advise on how I can effectively click this button with Selenium?
Thank you!
find_element_by_nameyou tried looks promising to me. Try to use it with wait