[英]why 2nd click action is not run when browser is Google Chrome
I don't konw why 2nd click action is not be run when browser is Google Chrome. 我不知道为什么当浏览器是Google Chrome时不能运行第二次点击动作。 The 1st input action: input text has been done, then 2nd click action failed to be run And there's nothing happened on the UI. 第一个输入操作:输入文本已完成,然后第二个单击操作无法运行,并且UI上没有任何反应。 Could anybody can tell me the reason? 有人可以告诉我原因吗?
test link: https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss 测试链接: https : //www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss
from selenium import webdriver driver=webdriver.Chrome() 从硒导入webdriver driver = webdriver.Chrome()
driver.get(' https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss ') driver.find_element_by_id("modelnumber").send_keys("7383AC1") driver.find_element_by_name("submit").click() driver.get(' https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss ')driver.find_element_by_id(“ modelnumber”)。send_keys(“ 7383AC1”)driver.find_element_by_name ( “提交”)。点击()
That page has 3 elements with the name "submit", so ChromeDriver is probably trying to click one that you're not expecting. 该页面包含3个名称为“ submit”的元素,因此ChromeDriver可能试图单击您不期望的元素。
Try finding by xpath or css. 尝试通过xpath或CSS查找。 I'm more familiar with XPath: 我对XPath更加熟悉:
driver.find_element_by_xpath("//input[@id='modelnumber']/../following-sibling::td/input[@name='submit']").click()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.