From 828262f6a11ed9dcd854c8f376535ecc3e86563f Mon Sep 17 00:00:00 2001 From: g1879 Date: Sat, 14 Sep 2024 17:23:38 +0800 Subject: [PATCH] =?UTF-8?q?4.1.0.0b24find()=E7=9A=84any=5Fone=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=BB=98=E8=AE=A4=E4=B8=BATrue=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/__init__.py | 2 +- DrissionPage/_base/base.py | 2 +- DrissionPage/_base/base.pyi | 2 +- DrissionPage/_functions/elements.pyi | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index e76efce..1ed1536 100644 --- a/DrissionPage/__init__.py +++ b/DrissionPage/__init__.py @@ -12,4 +12,4 @@ from ._pages.chromium_page import ChromiumPage from ._pages.session_page import SessionPage from ._pages.web_page import WebPage -__version__ = '4.1.0.0b24' +__version__ = '4.1.0.0' diff --git a/DrissionPage/_base/base.py b/DrissionPage/_base/base.py index 5b2a945..422e5f8 100644 --- a/DrissionPage/_base/base.py +++ b/DrissionPage/_base/base.py @@ -35,7 +35,7 @@ class BaseParser(object): def eles(self, locator, timeout=None): return self._ele(locator, timeout, index=None) - def find(self, locators, any_one=False, first_ele=True, timeout=None): + def find(self, locators, any_one=True, first_ele=True, timeout=None): if 'Session' in self._type: timeout = 0 if timeout is None: diff --git a/DrissionPage/_base/base.pyi b/DrissionPage/_base/base.pyi index c3b995b..afb01ca 100644 --- a/DrissionPage/_base/base.pyi +++ b/DrissionPage/_base/base.pyi @@ -38,7 +38,7 @@ class BaseParser(object): def find(self, locators: Union[str, List[str], tuple], - any_one: bool = False, + any_one: bool = True, first_ele: bool = True, timeout: float = None) -> Union[Dict[str, ChromiumElement], Dict[str, SessionElement], Dict[str, List[ChromiumElement]], Dict[str, List[SessionElement]]]: diff --git a/DrissionPage/_functions/elements.pyi b/DrissionPage/_functions/elements.pyi index 854548f..359f572 100644 --- a/DrissionPage/_functions/elements.pyi +++ b/DrissionPage/_functions/elements.pyi @@ -29,7 +29,7 @@ class SessionElementsList(list): def __next__(self) -> SessionElement: ... - def __getitem__(self, _i) -> SessionElement: ... + def __getitem__(self, _i) -> Union[SessionElement, List[SessionElement]]: ... @property def get(self) -> Getter: @@ -61,7 +61,7 @@ class ChromiumElementsList(SessionElementsList): def __next__(self) -> ChromiumElement: ... - def __getitem__(self, _i) -> ChromiumElement: ... + def __getitem__(self, _i) -> Union[ChromiumElement, List[ChromiumElement]]: ... @property def filter(self) -> ChromiumFilter: