元素
<input id="mainframe.childframe.form.div_main.form.div_work.form.edt_applicantMgmtName:input" class="nexainput" style="left:0px;top:0px;width:173px;height:26px;" value="예: 홍길동" type="text" data-security="on" tk_security="true">我的代码
driver.find_element_by_xpath('//input[@value="예: 홍길동"]').send_keys(name)但是它一直只点击元素。元素看起来像这样

我该怎么办?
发布于 2020-04-17 09:47:42
尝试清除webElement,然后在文本字段中发送字符序列。
ele.clear()
ele.sendkeys("text to send")如果这不起作用,尝试使用ActionChains通过键盘操作执行鼠标和键盘操作-单击,Ctrl + A,删除,然后发送字符序列。如下所示:
actions = ActionChains(driver)
actions.click(ele).key_down(Keys.CONTROL).send_keys("a").key_up(Keys.CONTROL).send_keys("Keys.Delete").send_keys("your-text").performhttps://stackoverflow.com/questions/61261933
复制相似问题