Skip to content

Latest commit

 

History

History
33 lines (17 loc) · 571 Bytes

11-13-定位元素的8个方法是什么-.md

File metadata and controls

33 lines (17 loc) · 571 Bytes

11-13-定位元素的8个方法是什么-

1、通过id定位

find_element_by_id()

2、通过name定位

find_element_by_name()

3、通过 class name定位

find_element_by_class_name()

4、通过css定位

find_element_by_css_selector()

5、通过link定位

find_element_by_link_text(‘文本’)没有空格一般a链接

6、通过 partial_link定位

find_element_by_partial_link_text(部分文本)--般有空格a链接

7、通过 xpath定位

find_element_by_xpath()

8、通过 tag_name定位

find_element_by_tag_name()