From ec6a2d449468835bded5c0d4a49ef0b0cb0a2a56 Mon Sep 17 00:00:00 2001 From: g1879 Date: Mon, 29 Jan 2024 23:43:08 +0800 Subject: [PATCH] =?UTF-8?q?4.0.4.3(+)=20=E5=A2=9E=E5=8A=A0add=5Fele()=20ru?= =?UTF-8?q?n=5Fjs()=E5=8F=AF=E8=AF=BB=E5=8F=96=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A7=E7=89=88python=E4=B8=ADget()?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=20click.multiple()?= =?UTF-8?q?=E6=94=B9=E4=B8=BAclick.multi()?= 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/_pages/chromium_base.py | 2 +- DrissionPage/_pages/chromium_base.pyi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index 029e38e..c5d6e7a 100644 --- a/DrissionPage/__init__.py +++ b/DrissionPage/__init__.py @@ -14,4 +14,4 @@ from ._configs.chromium_options import ChromiumOptions from ._configs.session_options import SessionOptions __all__ = ['ChromiumPage', 'ChromiumOptions', 'SessionOptions', 'SessionPage', 'WebPage', '__version__'] -__version__ = '4.0.4.2' +__version__ = '4.0.4.3' diff --git a/DrissionPage/_base/base.py b/DrissionPage/_base/base.py index 4c5e344..600a3f1 100644 --- a/DrissionPage/_base/base.py +++ b/DrissionPage/_base/base.py @@ -405,7 +405,7 @@ class BasePage(BaseParser): :return: 重试次数、间隔、是否文件组成的tuple """ is_file = False - if isinstance(url, Path) or '://' not in url or ':\\\\' not in url: + if isinstance(url, Path) or ('://' not in url and ':\\\\' not in url): p = Path(url) if p.exists(): url = str(p.absolute()) diff --git a/DrissionPage/_pages/chromium_base.py b/DrissionPage/_pages/chromium_base.py index d738b63..92cb9a7 100644 --- a/DrissionPage/_pages/chromium_base.py +++ b/DrissionPage/_pages/chromium_base.py @@ -668,7 +668,7 @@ class ChromiumBase(BasePage): if ele: self.run_cdp('DOM.removeNode', nodeId=ele._node_id) - def add_ele(self, outerHTML, insert_to, before=None): + def add_ele(self, outerHTML, insert_to=None, before=None): """新建一个元素 :param outerHTML: 新元素的html文本 :param insert_to: 插入到哪个元素中,可接收元素对象和定位符,为None添加到body diff --git a/DrissionPage/_pages/chromium_base.pyi b/DrissionPage/_pages/chromium_base.pyi index fd7dab4..d5e6e5e 100644 --- a/DrissionPage/_pages/chromium_base.pyi +++ b/DrissionPage/_pages/chromium_base.pyi @@ -216,7 +216,7 @@ class ChromiumBase(BasePage): def add_ele(self, outerHTML: str, - insert_to: Optional[ChromiumElement, str, Tuple[str, str]], + insert_to: Optional[ChromiumElement, str, Tuple[str, str]] = None, before: Optional[ChromiumElement, str, Tuple[str, str]] = None) -> ChromiumElement: ... def get_frame(self, loc_ind_ele: Union[str, int, tuple, ChromiumFrame], timeout: float = None) -> ChromiumFrame: ...