Python+Selenium基础篇之6-元素定位方法

2021/12/30 20:07:42

本文主要是介绍Python+Selenium基础篇之6-元素定位方法,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

WebDriver 提供了 8 种元素定位方法,在 Python 中,对应的方法如下:
 id 定位 → find_element_by_id()
 name 定位 → find_element_by_name()
 tag 定位 → find_element_by_tag_name()
 class 定位 → find_element_by_class_name()
 link_text → find_element_by_link_text()
 partial link 定位 → find_element_by_partial_link_text()
 XPath 定位 → find_element_by_xpath()
 CSS_selector 定位 → find_element_by_css_selector()



这篇关于Python+Selenium基础篇之6-元素定位方法的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程