mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
调整注释
This commit is contained in:
parent
168e347081
commit
79b61704c7
@ -186,13 +186,17 @@ class DriverElement(DrissionElement):
|
||||
loc_or_str: Union[Tuple[str, str], str],
|
||||
mode: str = None,
|
||||
timeout: float = None):
|
||||
"""返回当前元素下级符合条件的子元素、属性或节点文本,默认返回第一个 \n
|
||||
"""返回当前元素下级符合条件的子元素、属性或节点文本,默认返回第一个 \n
|
||||
示例: \n
|
||||
- 用loc元组查找: \n
|
||||
ele.ele((By.CLASS_NAME, 'ele_class')) - 返回第一个class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
ele.ele('.ele_class') - 返回第一个 class 为 ele_class 的子元素 \n
|
||||
ele.ele('.:ele_class') - 返回第一个 class 中含有 ele_class 的子元素 \n
|
||||
ele.ele('#ele_id') - 返回第一个 id 为 ele_id 的子元素 \n
|
||||
ele.ele('#:ele_id') - 返回第一个 id 中含有 ele_id 的子元素 \n
|
||||
ele.ele('@class:ele_class') - 返回第一个class含有ele_class的子元素 \n
|
||||
ele.ele('@name=ele_name') - 返回第一个name等于ele_name的子元素 \n
|
||||
ele.ele('@placeholder') - 返回第一个带placeholder属性的子元素 \n
|
||||
@ -244,8 +248,12 @@ class DriverElement(DrissionElement):
|
||||
- 用loc元组查找: \n
|
||||
ele.eles((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
ele.eles('.ele_class') - 返回所有 class 为 ele_class 的子元素 \n
|
||||
ele.eles('.:ele_class') - 返回所有 class 中含有 ele_class 的子元素 \n
|
||||
ele.eles('#ele_id') - 返回所有 id 为 ele_id 的子元素 \n
|
||||
ele.eles('#:ele_id') - 返回所有 id 中含有 ele_id 的子元素 \n
|
||||
ele.eles('@class:ele_class') - 返回所有class含有ele_class的子元素 \n
|
||||
ele.eles('@name=ele_name') - 返回所有name等于ele_name的子元素 \n
|
||||
ele.eles('@placeholder') - 返回所有带placeholder属性的子元素 \n
|
||||
|
@ -116,8 +116,12 @@ class DriverPage(object):
|
||||
- 用loc元组查找: \n
|
||||
ele.ele((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.ele('.ele_class') - 返回第一个 class 为 ele_class 的元素 \n
|
||||
page.ele('.:ele_class') - 返回第一个 class 中含有 ele_class 的元素 \n
|
||||
page.ele('#ele_id') - 返回第一个 id 为 ele_id 的元素 \n
|
||||
page.ele('#:ele_id') - 返回第一个 id 中含有 ele_id 的元素 \n
|
||||
page.ele('@class:ele_class') - 返回第一个class含有ele_class的元素 \n
|
||||
page.ele('@name=ele_name') - 返回第一个name等于ele_name的元素 \n
|
||||
page.ele('@placeholder') - 返回第一个带placeholder属性的元素 \n
|
||||
@ -171,8 +175,12 @@ class DriverPage(object):
|
||||
- 用loc元组查找: \n
|
||||
page.eles((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.eles('.ele_class') - 返回所有 class 为 ele_class 的元素 \n
|
||||
page.eles('.:ele_class') - 返回所有 class 中含有 ele_class 的元素 \n
|
||||
page.eles('#ele_id') - 返回所有 id 为 ele_id 的元素 \n
|
||||
page.eles('#:ele_id') - 返回所有 id 中含有 ele_id 的元素 \n
|
||||
page.eles('@class:ele_class') - 返回所有class含有ele_class的元素 \n
|
||||
page.eles('@name=ele_name') - 返回所有name等于ele_name的元素 \n
|
||||
page.eles('@placeholder') - 返回所有带placeholder属性的元素 \n
|
||||
|
@ -311,15 +311,19 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
loc_or_ele: Union[Tuple[str, str], str, DriverElement, SessionElement, WebElement],
|
||||
mode: str = None,
|
||||
timeout: float = None) -> Union[DriverElement, SessionElement, str]:
|
||||
"""返回页面中符合条件的元素、属性或节点文本,默认返回第一个 \n
|
||||
"""返回页面中符合条件的元素、属性或节点文本,默认返回第一个 \n
|
||||
示例: \n
|
||||
- 接收到元素对象时: \n
|
||||
返回元素对象对象 \n
|
||||
- 用loc元组查找: \n
|
||||
ele.ele((By.CLASS_NAME, 'ele_class')) - 返回第一个class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.ele('.ele_class') - 返回第一个 class 为 ele_class 的元素 \n
|
||||
page.ele('.:ele_class') - 返回第一个 class 中含有 ele_class 的元素 \n
|
||||
page.ele('#ele_id') - 返回第一个 id 为 ele_id 的元素 \n
|
||||
page.ele('#:ele_id') - 返回第一个 id 中含有 ele_id 的元素 \n
|
||||
page.ele('@class:ele_class') - 返回第一个class含有ele_class的元素 \n
|
||||
page.ele('@name=ele_name') - 返回第一个name等于ele_name的元素 \n
|
||||
page.ele('@placeholder') - 返回第一个带placeholder属性的元素 \n
|
||||
@ -352,8 +356,12 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
- 用loc元组查找: \n
|
||||
page.eles((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.eles('.ele_class') - 返回所有 class 为 ele_class 的元素 \n
|
||||
page.eles('.:ele_class') - 返回所有 class 中含有 ele_class 的元素 \n
|
||||
page.eles('#ele_id') - 返回所有 id 为 ele_id 的元素 \n
|
||||
page.eles('#:ele_id') - 返回所有 id 中含有 ele_id 的元素 \n
|
||||
page.eles('@class:ele_class') - 返回所有class含有ele_class的元素 \n
|
||||
page.eles('@name=ele_name') - 返回所有name等于ele_name的元素 \n
|
||||
page.eles('@placeholder') - 返回所有带placeholder属性的元素 \n
|
||||
|
@ -174,8 +174,12 @@ class SessionElement(DrissionElement):
|
||||
- 用loc元组查找: \n
|
||||
ele.ele((By.CLASS_NAME, 'ele_class')) - 返回第一个class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
ele.ele('.ele_class') - 返回第一个 class 为 ele_class 的子元素 \n
|
||||
ele.ele('.:ele_class') - 返回第一个 class 中含有 ele_class 的子元素 \n
|
||||
ele.ele('#ele_id') - 返回第一个 id 为 ele_id 的子元素 \n
|
||||
ele.ele('#:ele_id') - 返回第一个 id 中含有 ele_id 的子元素 \n
|
||||
ele.ele('@class:ele_class') - 返回第一个class含有ele_class的子元素 \n
|
||||
ele.ele('@name=ele_name') - 返回第一个name等于ele_name的子元素 \n
|
||||
ele.ele('@placeholder') - 返回第一个带placeholder属性的子元素 \n
|
||||
@ -224,8 +228,12 @@ class SessionElement(DrissionElement):
|
||||
- 用loc元组查找: \n
|
||||
ele.eles((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
ele.eles('.ele_class') - 返回所有 class 为 ele_class 的子元素 \n
|
||||
ele.eles('.:ele_class') - 返回所有 class 中含有 ele_class 的子元素 \n
|
||||
ele.eles('#ele_id') - 返回所有 id 为 ele_id 的子元素 \n
|
||||
ele.eles('#:ele_id') - 返回所有 id 中含有 ele_id 的子元素 \n
|
||||
ele.eles('@class:ele_class') - 返回所有class含有ele_class的子元素 \n
|
||||
ele.eles('@name=ele_name') - 返回所有name等于ele_name的子元素 \n
|
||||
ele.eles('@placeholder') - 返回所有带placeholder属性的子元素 \n
|
||||
|
@ -77,8 +77,12 @@ class SessionPage(object):
|
||||
- 用loc元组查找: \n
|
||||
ele.ele((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的子元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.ele('.ele_class') - 返回第一个 class 为 ele_class 的元素 \n
|
||||
page.ele('.:ele_class') - 返回第一个 class 中含有 ele_class 的元素 \n
|
||||
page.ele('#ele_id') - 返回第一个 id 为 ele_id 的元素 \n
|
||||
page.ele('#:ele_id') - 返回第一个 id 中含有 ele_id 的元素 \n
|
||||
page.ele('@class:ele_class') - 返回第一个class含有ele_class的元素 \n
|
||||
page.ele('@name=ele_name') - 返回第一个name等于ele_name的元素 \n
|
||||
page.ele('@placeholder') - 返回第一个带placeholder属性的元素 \n
|
||||
@ -123,8 +127,12 @@ class SessionPage(object):
|
||||
- 用loc元组查找: \n
|
||||
page.eles((By.CLASS_NAME, 'ele_class')) - 返回所有class为ele_class的元素 \n
|
||||
- 用查询字符串查找: \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector \n
|
||||
其中,@表示属性,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
查找方式:属性、tag name和属性、文本、xpath、css selector、id、class \n
|
||||
@表示属性,.表示class,#表示id,=表示精确匹配,:表示模糊匹配,无控制字符串时默认搜索该字符串 \n
|
||||
page.eles('.ele_class') - 返回所有 class 为 ele_class 的元素 \n
|
||||
page.eles('.:ele_class') - 返回所有 class 中含有 ele_class 的元素 \n
|
||||
page.eles('#ele_id') - 返回所有 id 为 ele_id 的元素 \n
|
||||
page.eles('#:ele_id') - 返回所有 id 中含有 ele_id 的元素 \n
|
||||
page.eles('@class:ele_class') - 返回所有class含有ele_class的元素 \n
|
||||
page.eles('@name=ele_name') - 返回所有name等于ele_name的元素 \n
|
||||
page.eles('@placeholder') - 返回所有带placeholder属性的元素 \n
|
||||
|
Loading…
x
Reference in New Issue
Block a user