Selenium Python-无法单击表单按钮

时间:2018-08-03 19:28:02

标签: python selenium-webdriver

无法单击表单按钮,但可以在屏幕上看到它。我可以看到该按钮,但由于某种原因无法单击它,因此该按钮肯定在屏幕中间。尝试过,xpath,id,class等。它上面似乎有一个按钮,也隐藏了相同的id。 html也包括在这里。不知道我在想什么。谢谢

driver = webdriver.Chrome()

1 个答案:

答案 0 :(得分:1)

此链接有所帮助-WebDriverException: Message: TypeError: rect is undefined

There were two elements with the same xpath and id so i had to use the below code to click on the second one  

import_btn = driver.find_elements(By.XPATH, '//*[@id="import_button"]')[1]  
hov = ActionChains(driver).move_to_element(import_btn)  
time.sleep(6)  
hov.click()  
hov.perform()