[英]Python Selenium: input textbox, send_keys not working (angular javascript??)
Python Selenium:输入文本框,send_keys 不起作用。
我是python的新手。
我正在使用 Selenium 在文本框中输入新文本。 但是,无法清除现有数据,也无法输入新文本。
element = driver.find_element_by_xpath("//li//mini-quote//div//mini-quote-symbol-info//div//quote-symbol-input//div[@class='container']")
element.click() # <== OK, clicked
element.clear() # <== error message "ElementNotInteractableException: Message: element not interactable"
我认为该元素已找到(因为它被点击了),但无论如何,clear()、send_keys() 函数在该网站上不起作用。 问题是什么?
检查中的源代码如下。
(图片)在此输入图片说明
如上面的网络源代码,
谢谢。
尝试与 ActionChains 交互:
element = driver.find_element_by_xpath("//li//mini-quote//div//mini-quote-symbol-info//div//quote-symbol-input//div[@class='container']")
ActionChains(driver).move_to_element(element).click().perform()
并确保以全屏模式启动浏览器:
driver.maximize_window()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.