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