selenium
文章平均质量分 52
sk无法
这个作者很懒,什么都没留下…
展开
-
selenium学习(二)
frame或iframe非常特殊,在html语法中,内部会包含一个嵌入的另一份html文档。通过switch_to.frame切换到iframe里面去寻找html代码通过src去定位到不同的frame标签通过wd.switch_to.default_content() #切换到iframe外部from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.comm原创 2022-04-29 10:59:09 · 372 阅读 · 0 评论 -
selenium学习(一)
selenium初体验:from selenium import webdriverfrom selenium.webdriver.common.by import By#from selenium.webdriver.chrome.service import Service#wd=webdriver.Chrome(service=Service(r'C:\newapp01\chromedriver\chromedriver.exe'))wd=webdriver.Chrome() #将chr原创 2022-04-29 10:58:40 · 864 阅读 · 0 评论 -
selenium的clear()失效的问题
在我绑定一个ID后,输入第一个数据,clear()清空后,在输入第二个,但是clear始终失效。在百般查询后,看到这个博客如果元素定位到了,但是clear没有效果,根本原因是:存在镜像节点. 操作clear()清掉数据后,镜像节点的数据还在,所以数据会补充回去觉得很有道理,应该clear并没有清除本地浏览器上面input输入的数据,它仍然保存在浏览器上面。另外一个说法:clear()方法注释: /**If this element is a form entry element, th原创 2022-04-21 11:31:10 · 2915 阅读 · 0 评论