From 00db0af61ab417188e589bbe234bc09372bfb7e1 Mon Sep 17 00:00:00 2001 From: g1879 Date: Thu, 23 Mar 2023 23:57:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E8=88=AC=E8=8E=B7=E5=8F=96=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E6=96=B9=E6=B3=95=E5=8F=96=E6=B6=88ChromiumFrame?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/chromium_base.pyi | 6 +++--- DrissionPage/chromium_element.pyi | 12 ++++++------ DrissionPage/chromium_frame.pyi | 18 +++++++++--------- DrissionPage/chromium_tab.pyi | 6 +++--- DrissionPage/commons/locator.py | 2 +- DrissionPage/web_page.pyi | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/DrissionPage/chromium_base.pyi b/DrissionPage/chromium_base.pyi index 3632bc8..de26cd9 100644 --- a/DrissionPage/chromium_base.pyi +++ b/DrissionPage/chromium_base.pyi @@ -69,7 +69,7 @@ class ChromiumBase(BasePage): def _set_runtime_settings(self) -> None: ... def __call__(self, loc_or_str: Union[Tuple[str, str], str, ChromiumElement], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, NoneElement]: ... + timeout: float = None) -> ChromiumElement: ... @property def title(self) -> str: ... @@ -146,11 +146,11 @@ class ChromiumBase(BasePage): def ele(self, loc_or_ele: Union[Tuple[str, str], str, ChromiumElement, ChromiumFrame], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, NoneElement]: ... + timeout: float = None) -> ChromiumElement: ... def eles(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> List[Union[ChromiumElement, ChromiumFrame]]: ... + timeout: float = None) -> List[ChromiumElement]: ... def s_ele(self, loc_or_ele: Union[Tuple[str, str], str] = None) \ -> Union[SessionElement, str, NoneElement]: ... diff --git a/DrissionPage/chromium_element.pyi b/DrissionPage/chromium_element.pyi index 1f4fc70..8d44fb4 100644 --- a/DrissionPage/chromium_element.pyi +++ b/DrissionPage/chromium_element.pyi @@ -40,7 +40,7 @@ class ChromiumElement(DrissionElement): def __call__(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + timeout: float = None) -> Union[ChromiumElement, str, None]: ... @property def tag(self) -> str: ... @@ -159,11 +159,11 @@ class ChromiumElement(DrissionElement): def ele(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, str, NoneElement]: ... + timeout: float = None) -> Union[ChromiumElement, str]: ... def eles(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> List[Union[ChromiumElement, ChromiumFrame, str]]: ... + timeout: float = None) -> List[Union[ChromiumElement, str]]: ... def s_ele(self, loc_or_str: Union[Tuple[str, str], str] = None) -> Union[SessionElement, str, NoneElement]: ... @@ -247,7 +247,7 @@ class ChromiumShadowRoot(BaseElement): def __call__(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, None]: ... + timeout: float = None) -> ChromiumElement: ... @property def ids(self) -> Ids: ... @@ -292,11 +292,11 @@ class ChromiumShadowRoot(BaseElement): def ele(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, NoneElement]: ... + timeout: float = None) -> Union[ChromiumElement]: ... def eles(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> List[Union[ChromiumElement, ChromiumFrame]]: ... + timeout: float = None) -> List[ChromiumElement]: ... def s_ele(self, loc_or_str: Union[Tuple[str, str], str] = None) -> Union[SessionElement, str, NoneElement]: ... diff --git a/DrissionPage/chromium_frame.pyi b/DrissionPage/chromium_frame.pyi index 947337f..b9b9edb 100644 --- a/DrissionPage/chromium_frame.pyi +++ b/DrissionPage/chromium_frame.pyi @@ -27,7 +27,7 @@ class ChromiumFrame(ChromiumBase): def __call__(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + timeout: float = None) -> Union[ChromiumElement, str]: ... def __repr__(self) -> str: ... @@ -118,38 +118,38 @@ class ChromiumFrame(ChromiumBase): def prev(self, filter_loc: Union[tuple, str] = '', index: int = 1, timeout: float = 0, - ele_only: bool = True) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + ele_only: bool = True) -> Union[ChromiumElement, str]: ... def next(self, filter_loc: Union[tuple, str] = '', index: int = 1, timeout: float = 0, - ele_only: bool = True) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + ele_only: bool = True) -> Union[ChromiumElement, str]: ... def before(self, filter_loc: Union[tuple, str] = '', index: int = 1, timeout: float = None, - ele_only: bool = True) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + ele_only: bool = True) -> Union[ChromiumElement, str]: ... def after(self, filter_loc: Union[tuple, str] = '', index: int = 1, timeout: float = None, - ele_only: bool = True) -> Union[ChromiumElement, ChromiumFrame, str, None]: ... + ele_only: bool = True) -> Union[ChromiumElement, str]: ... def prevs(self, filter_loc: Union[tuple, str] = '', timeout: float = 0, - ele_only: bool = True) -> List[Union[ChromiumElement, ChromiumFrame, str]]: ... + ele_only: bool = True) -> List[Union[ChromiumElement, str]]: ... def nexts(self, filter_loc: Union[tuple, str] = '', timeout: float = 0, - ele_only: bool = True) -> List[Union[ChromiumElement, ChromiumFrame, str]]: ... + ele_only: bool = True) -> List[Union[ChromiumElement, str]]: ... def befores(self, filter_loc: Union[tuple, str] = '', timeout: float = None, - ele_only: bool = True) -> List[Union[ChromiumElement, ChromiumFrame, str]]: ... + ele_only: bool = True) -> List[Union[ChromiumElement, str]]: ... def afters(self, filter_loc: Union[tuple, str] = '', timeout: float = None, - ele_only: bool = True) -> List[Union[ChromiumElement, ChromiumFrame, str]]: ... + ele_only: bool = True) -> List[Union[ChromiumElement, str]]: ... def get_screenshot(self, path: [str, Path] = None, as_bytes: [bool, str] = None, diff --git a/DrissionPage/chromium_tab.pyi b/DrissionPage/chromium_tab.pyi index 915c03d..f9682b2 100644 --- a/DrissionPage/chromium_tab.pyi +++ b/DrissionPage/chromium_tab.pyi @@ -36,7 +36,7 @@ class WebPageTab(SessionPage, ChromiumTab): def __call__(self, loc_or_str: Union[Tuple[str, str], str, ChromiumElement, SessionElement], - timeout: float = None) -> Union[ChromiumElement, SessionElement, ChromiumFrame, None]: ... + timeout: float = None) -> Union[ChromiumElement, SessionElement]: ... @property def url(self) -> Union[str, None]: ... @@ -96,11 +96,11 @@ class WebPageTab(SessionPage, ChromiumTab): def ele(self, loc_or_ele: Union[Tuple[str, str], str, ChromiumElement, SessionElement], - timeout: float = None) -> Union[ChromiumElement, SessionElement, ChromiumFrame, str, None]: ... + timeout: float = None) -> Union[ChromiumElement, SessionElement, str]: ... def eles(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> List[Union[ChromiumElement, SessionElement, ChromiumFrame, str]]: ... + timeout: float = None) -> List[Union[ChromiumElement, SessionElement, str]]: ... def s_ele(self, loc_or_ele: Union[Tuple[str, str], str] = None) \ -> Union[SessionElement, str, None]: ... diff --git a/DrissionPage/commons/locator.py b/DrissionPage/commons/locator.py index 27e2b0a..9daeb16 100644 --- a/DrissionPage/commons/locator.py +++ b/DrissionPage/commons/locator.py @@ -108,7 +108,7 @@ def str_to_loc(loc): elif loc.startswith(('css:', 'css=')) and loc not in ('css:', 'css='): loc_by = 'css selector' loc_str = loc[4:] - elif loc.startswith(('c:', 'c=')) and loc not in ('c:', 'cx='): + elif loc.startswith(('c:', 'c=')) and loc not in ('c:', 'c='): loc_by = 'css selector' loc_str = loc[2:] diff --git a/DrissionPage/web_page.pyi b/DrissionPage/web_page.pyi index 59eda0b..e89fd69 100644 --- a/DrissionPage/web_page.pyi +++ b/DrissionPage/web_page.pyi @@ -40,7 +40,7 @@ class WebPage(SessionPage, ChromiumPage, BasePage): def __call__(self, loc_or_str: Union[Tuple[str, str], str, ChromiumElement, SessionElement], - timeout: float = None) -> Union[ChromiumElement, SessionElement, ChromiumFrame, None]: ... + timeout: float = None) -> Union[ChromiumElement, SessionElement]: ... # -----------------共有属性和方法------------------- @property @@ -107,11 +107,11 @@ class WebPage(SessionPage, ChromiumPage, BasePage): def ele(self, loc_or_ele: Union[Tuple[str, str], str, ChromiumElement, SessionElement], - timeout: float = None) -> Union[ChromiumElement, SessionElement, ChromiumFrame, str, None]: ... + timeout: float = None) -> Union[ChromiumElement, SessionElement, str]: ... def eles(self, loc_or_str: Union[Tuple[str, str], str], - timeout: float = None) -> List[Union[ChromiumElement, SessionElement, ChromiumFrame, str]]: ... + timeout: float = None) -> List[Union[ChromiumElement, SessionElement, str]]: ... def s_ele(self, loc_or_ele: Union[Tuple[str, str], str] = None) \ -> Union[SessionElement, str, None]: ...