mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调注释
This commit is contained in:
parent
78d3b90653
commit
ff1ce0b691
@ -31,6 +31,8 @@ class SessionElementsList(list):
|
|||||||
|
|
||||||
def __getitem__(self, _i) -> SessionElement: ...
|
def __getitem__(self, _i) -> SessionElement: ...
|
||||||
|
|
||||||
|
def __iter__(self) -> List[SessionElement]: ...
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def get(self) -> Getter:
|
def get(self) -> Getter:
|
||||||
"""返回用于属性的对象"""
|
"""返回用于属性的对象"""
|
||||||
@ -63,6 +65,8 @@ class ChromiumElementsList(SessionElementsList):
|
|||||||
|
|
||||||
def __getitem__(self, _i) -> ChromiumElement: ...
|
def __getitem__(self, _i) -> ChromiumElement: ...
|
||||||
|
|
||||||
|
def __iter__(self) -> List[ChromiumElement]: ...
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def filter(self) -> ChromiumFilter:
|
def filter(self) -> ChromiumFilter:
|
||||||
"""返回用于筛选多个元素的对象"""
|
"""返回用于筛选多个元素的对象"""
|
||||||
|
@ -104,8 +104,8 @@ class MixTab(SessionPage, ChromiumTab, BasePage):
|
|||||||
return self.response
|
return self.response
|
||||||
|
|
||||||
def ele(self, locator, index=1, timeout=None):
|
def ele(self, locator, index=1, timeout=None):
|
||||||
return super(SessionPage, self).ele(locator, index=index, timeout=timeout) if self._d_mode \
|
return (super(SessionPage, self).ele(locator, index=index, timeout=timeout)
|
||||||
else super().ele(locator, index=index)
|
if self._d_mode else super().ele(locator, index=index))
|
||||||
|
|
||||||
def eles(self, locator, timeout=None):
|
def eles(self, locator, timeout=None):
|
||||||
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)
|
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)
|
||||||
|
@ -215,7 +215,7 @@ class MixTab(SessionPage, ChromiumTab):
|
|||||||
|
|
||||||
def eles(self,
|
def eles(self,
|
||||||
locator: Union[Tuple[str, str], str],
|
locator: Union[Tuple[str, str], str],
|
||||||
timeout: float = None) -> ChromiumElementsList:
|
timeout: float = None) -> Union[ChromiumElementsList, SessionElementsList]:
|
||||||
"""返回页面中所有符合条件的元素、属性或节点文本
|
"""返回页面中所有符合条件的元素、属性或节点文本
|
||||||
:param locator: 元素的定位信息,可以是loc元组,或查询字符串
|
:param locator: 元素的定位信息,可以是loc元组,或查询字符串
|
||||||
:param timeout: 查找元素超时时间(秒),默认与页面等待时间一致
|
:param timeout: 查找元素超时时间(秒),默认与页面等待时间一致
|
||||||
|
@ -128,8 +128,8 @@ class WebPage(SessionPage, ChromiumPage, BasePage):
|
|||||||
return super().post(url, show_errmsg, retry, interval, **kwargs)
|
return super().post(url, show_errmsg, retry, interval, **kwargs)
|
||||||
|
|
||||||
def ele(self, locator, index=1, timeout=None):
|
def ele(self, locator, index=1, timeout=None):
|
||||||
return super(SessionPage, self).ele(locator, index=index, timeout=timeout) if self._d_mode \
|
return (super(SessionPage, self).ele(locator, index=index, timeout=timeout)
|
||||||
else super().ele(locator, index=index)
|
if self._d_mode else super().ele(locator, index=index))
|
||||||
|
|
||||||
def eles(self, locator, timeout=None):
|
def eles(self, locator, timeout=None):
|
||||||
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)
|
return super(SessionPage, self).eles(locator, timeout=timeout) if self._d_mode else super().eles(locator)
|
||||||
|
@ -230,7 +230,7 @@ class WebPage(SessionPage, ChromiumPage, BasePage):
|
|||||||
|
|
||||||
def eles(self,
|
def eles(self,
|
||||||
locator: Union[Tuple[str, str], str],
|
locator: Union[Tuple[str, str], str],
|
||||||
timeout: float = None) -> ChromiumElementsList:
|
timeout: float = None) -> Union[ChromiumElementsList, SessionElementsList]:
|
||||||
"""返回页面中所有符合条件的元素、属性或节点文本
|
"""返回页面中所有符合条件的元素、属性或节点文本
|
||||||
:param locator: 元素的定位信息,可以是loc元组,或查询字符串
|
:param locator: 元素的定位信息,可以是loc元组,或查询字符串
|
||||||
:param timeout: 查找元素超时时间(秒),默认与页面等待时间一致
|
:param timeout: 查找元素超时时间(秒),默认与页面等待时间一致
|
||||||
|
Loading…
x
Reference in New Issue
Block a user