定位 元素 / 一组元素
最后更新于:2022-04-02 03:42:27
[TOC]
## 概述
Selenium提供了8种定位方式。
```
id -> find_element_by_id()
name -> find_element_by_name()
class name -> find_element_by_class_name()
tag name -> find_element_by_tag_name()
link text -> find_element_by_link_text()
partial link text -> find_element_by_partial_link_text()
xpath -> find_element_by_xpath()
css selector -> find_element_by_css_selector()
//定位一组元素
find_elements_by_id()
find_elements_by_name()
find_elements_by_class_name()
find_elements_by_tag_name()
find_elements_by_link_text()
find_elements_by_partial_link_text()
find_elements_by_xpath()
find_elements_by_css_selector()
```
## 定位用法
```
';