send_keys报错element not interactable
发布时间:2020-12-14 04:44:15 所属栏目:百科 来源:网络整理
导读:这两天要在阿里云日志中操作UI,以输入关键字搜索日志。 在send_keys时报错element not interactable。 iframe 第一个问题是iframe,通过切换iframe解决: driver.switch_to.frame(0) # 索引从0开始 span 第二个问题是span。 F12查看html长这样: ①find_ele
这两天要在阿里云日志中操作UI,以输入关键字搜索日志。 在send_keys时报错element not interactable。 iframe第一个问题是iframe,通过切换iframe解决:
span第二个问题是span。 F12查看html长这样: ①find_element(pre).click 有效,说明iframe切换成功了 ②find_element(span2).send_keys报错
span不支持send_keys。 第一个方法,通过调js来解决,设置span的innerText
第二个方法,添加属性contenteditable
不简单虽然值设置成功了,但是不能用,在查询时,还是用空值在查询。 经过分析,得出以下线索:
网上很多的方案是<input>标签,比较好解决,阿里的这个span还真有点不简单。 chrome console调试js最后分享一下chrome console调试js的方法。 F12后,在元素上右键,选择Copy selector,复制selector 切换到console,输入即可定位到该元素: (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |