mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
增加wait()
方法
This commit is contained in:
parent
8170d53c97
commit
0b96412146
@ -80,6 +80,8 @@ class SessionPageSetter(object):
|
|||||||
|
|
||||||
def retry_interval(self, interval: float) -> None: ...
|
def retry_interval(self, interval: float) -> None: ...
|
||||||
|
|
||||||
|
def download_path(self, path: Union[str, Path]) -> None: ...
|
||||||
|
|
||||||
def timeout(self, second: float) -> None: ...
|
def timeout(self, second: float) -> None: ...
|
||||||
|
|
||||||
def cookie(self, cookie: Union[Cookie, str, dict]) -> None: ...
|
def cookie(self, cookie: Union[Cookie, str, dict]) -> None: ...
|
||||||
|
@ -12,6 +12,13 @@ class ChromiumBaseWaiter(object):
|
|||||||
"""
|
"""
|
||||||
self._driver = page_or_ele
|
self._driver = page_or_ele
|
||||||
|
|
||||||
|
def __call__(self, second):
|
||||||
|
"""等待若干秒
|
||||||
|
:param second: 秒数
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
sleep(second)
|
||||||
|
|
||||||
def ele_delete(self, loc_or_ele, timeout=None, raise_err=None):
|
def ele_delete(self, loc_or_ele, timeout=None, raise_err=None):
|
||||||
"""等待元素从DOM中删除
|
"""等待元素从DOM中删除
|
||||||
:param loc_or_ele: 要等待的元素,可以是已有元素、定位符
|
:param loc_or_ele: 要等待的元素,可以是已有元素、定位符
|
||||||
@ -223,6 +230,13 @@ class ChromiumElementWaiter(object):
|
|||||||
self._page = page
|
self._page = page
|
||||||
self._ele = ele
|
self._ele = ele
|
||||||
|
|
||||||
|
def __call__(self, second):
|
||||||
|
"""等待若干秒
|
||||||
|
:param second: 秒数
|
||||||
|
:return: None
|
||||||
|
"""
|
||||||
|
sleep(second)
|
||||||
|
|
||||||
def delete(self, timeout=None, raise_err=None):
|
def delete(self, timeout=None, raise_err=None):
|
||||||
"""等待元素从dom删除
|
"""等待元素从dom删除
|
||||||
:param timeout: 超时时间,为None使用元素所在页面timeout属性
|
:param timeout: 超时时间,为None使用元素所在页面timeout属性
|
||||||
|
@ -15,6 +15,8 @@ class ChromiumBaseWaiter(object):
|
|||||||
def __init__(self, page: ChromiumBase):
|
def __init__(self, page: ChromiumBase):
|
||||||
self._driver: ChromiumBase = ...
|
self._driver: ChromiumBase = ...
|
||||||
|
|
||||||
|
def __call__(self, second: float) -> None: ...
|
||||||
|
|
||||||
def ele_delete(self, loc_or_ele: Union[str, tuple, ChromiumElement], timeout: float = None,
|
def ele_delete(self, loc_or_ele: Union[str, tuple, ChromiumElement], timeout: float = None,
|
||||||
raise_err: bool = None) -> bool: ...
|
raise_err: bool = None) -> bool: ...
|
||||||
|
|
||||||
@ -60,6 +62,8 @@ class ChromiumElementWaiter(object):
|
|||||||
self._ele: ChromiumElement = ...
|
self._ele: ChromiumElement = ...
|
||||||
self._page: ChromiumBase = ...
|
self._page: ChromiumBase = ...
|
||||||
|
|
||||||
|
def __call__(self, second: float) -> None: ...
|
||||||
|
|
||||||
def delete(self, timeout: float = None, raise_err: bool = None) -> bool: ...
|
def delete(self, timeout: float = None, raise_err: bool = None) -> bool: ...
|
||||||
|
|
||||||
def display(self, timeout: float = None, raise_err: bool = None) -> bool: ...
|
def display(self, timeout: float = None, raise_err: bool = None) -> bool: ...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user