webDriver API——第6部分Locate elements By

These are the attributes which can be used to locate elements. See the Locating Elements chapter for example usages.

The By implementation.

class selenium.webdriver.common.by.By

Bases: object

Set of supported locator strategies.

classmethod is_valid(by)
CLASS_NAME= 'class name'
CSS_SELECTOR= 'css selector'
ID= 'id'
NAME= 'name'
TAG_NAME= 'tag name'
XPATH= 'xpath'
原文地址:https://www.cnblogs.com/hushaojun/p/4467486.html