![图片[1]-python3 selenium如何清空输入框中的内容-uusu优素-乐高,模型,3d打印,编程](http://uusucn.zbbe.cn/wp-content/uploads/2024/01/5e73566b98911586.jpg)
使用场景:搜索的时候,我需要清除搜索框中其他的关键词
使用方法:driver.clear()
举例说明:
#设定搜索内容
search_content=['java','测试']
#定位搜索框的位置
search_key=self.driver.find_element_by_css_selector("input.search-key")
#清空搜索框中的内容
search_key.clear()
#搜索
search_key.send_keys(random.choice(self.search_content))原文来自:https://www.py.cn © 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END


















































暂无评论内容