概述
文章目录
- 1,find_element_by_xpath()查找
-
-
-
- 1,简单获取元素步骤
- 2,通过id和name使用的步骤
-
-
- 2,find_element_by_id()通过id定位
-
-
-
- 获取元素步骤:
-
-
- 3,find_element_by_name()
- 4.find_element_by_css_selector()
-
-
-
- 获取元素步骤:
-
-
- 5,find_element_by_class_name()通过class查找
-
-
-
- 获取元素步骤:
-
-
- 6, find_element_by_partial_link_text() 通过页面文字模糊查询
-
-
-
- 代码步骤
-
-
- 7, find_element_by_tag_name()
-
-
-
- 获取元素步骤
-
-
- 定位到要悬停的元素
-
-
-
- move = web.find_element_by_partial_link_text("我的淘宝")
-
-
- 对定位到的元素执行悬停操作
-
-
-
- ActionChains(web).move_to_element(move).perform()
-
-
点击和输入
先继操作
aaa.click()
清空/输入曹祖(只能操作可以输入文本的元素)
aaa.clear() 清空输入框
aaa.send_keys(data)
最后
以上就是彩色百褶裙为你收集整理的Selenium八种元素定位超详细(有截图)的全部内容,希望文章能够帮你解决Selenium八种元素定位超详细(有截图)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复