简体   繁体   English

为什么当浏览器是Google Chrome时第二次点击操作不运行

[英]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.

相关问题 为什么第二个线程没有启动? - Why is the 2nd thread not starting? Google Cloud Function (2nd) + Python Selenium - Chrome 无法启动:异常退出 - Google Cloud Function (2nd) + Python Selenium - Chrome failed to start: exited abnormally Python'IF'之后的第二条语句没有动作 - Python No Action on 2nd Statement After 'IF' 为什么 Flask 应用程序没有第二次运行? - Why Flask Application not running 2nd time? pd.csv_read 由于第二行,导入时逗号和点出现问题,不知道为什么? - pd.csv_read Problem with comma & dot when import because of the 2nd line, no idea WHY? 如何在selenium webdriver Python中用鼠标点击第二层元素? - How to click on the 2nd layer of element with mouse in selenium webdriver Python? 无法在python硒单元测试中运行第二个测试功能 - Unable to run 2nd test function in python selenium unittest 如何从第二个 window 在 tkinter 中将 function 作为按钮命令运行 - How to run a function as a button command in tkinter from a 2nd window 打开第二个python控制台来探测运行时变量? - open 2nd python console to probe run-time variable? 为什么我的循环第二次运行时出现错误? TypeError:“ int”对象没有属性“ __getitem__” - Why do I get and error when my loop runs the 2nd time? TypeError: 'int' object has no attribute '__getitem__'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM