There are 2 buttons in a page, and the difference between these 2 buttons is "onclick".
OK
OK
I was thinking to use xpath:
driver.find_element_by_xpath("//form[@id='update-container-id']/div/div/div/div[2]/div/div[2]/table[1]/tbody/tr[1]/td[8]/div[3]/div/div/div/div[3]/button").click()
But it responses the error as below:
selenium.common.exceptions.ElementNotInteractableException: Message: Element could not be scrolled into view
Does anyone can help me to click the 2nd button correctly? Thanks a lot.
解决方案
try with the x-path //button[@οnclick="check_security('wlan1security_div0')"]
driver.find_element_by_xpath("//button[@οnclick=\"check_security('wlan1security_div0')\"]").click()
Using Action class,
button = driver.find_element_by_xpath("//button[@οnclick=\"check_security('wlan1security_div0')\"]")
ActionChains(driver).move_to_element(button).click(button).perform()
using java script executor,
driver.execute_script("javascript:check_security('wlan1security_div0')")