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]: ...