From 8c1a549b21240820b9e543ba944aa6e5317566f4 Mon Sep 17 00:00:00 2001 From: g1879 Date: Wed, 28 Feb 2024 21:17:15 +0800 Subject: [PATCH] =?UTF-8?q?4.0.4.6=E4=BF=AE=E5=A4=8D=E7=94=A8css=E5=9C=A8?= =?UTF-8?q?=E5=85=83=E7=B4=A0=E4=B8=8B=E8=8E=B7=E5=8F=96=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=AD=90=E5=85=83=E7=B4=A0=E6=97=B6=E6=95=B0=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/__init__.py | 2 +- DrissionPage/_elements/chromium_element.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index e7678ae..8faccd9 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.5' +__version__ = '4.0.4.6' diff --git a/DrissionPage/_elements/chromium_element.py b/DrissionPage/_elements/chromium_element.py index 8cb416b..9c11a49 100644 --- a/DrissionPage/_elements/chromium_element.py +++ b/DrissionPage/_elements/chromium_element.py @@ -1256,7 +1256,7 @@ def find_by_css(ele, selector, index, timeout): else: obj_ids = [i['value']['objectId'] for i in ele.owner.run_cdp('Runtime.getProperties', objectId=res['result']['objectId'], - ownProperties=True)['result'][:-1]] + ownProperties=True)['result']] r = make_chromium_eles(ele.owner, _ids=obj_ids, index=index, is_obj_id=True) return None if r is False else r @@ -1291,9 +1291,7 @@ def make_chromium_eles(page, _ids, index=1, is_obj_id=True, ele_only=False): if ele_only: for obj_id in _ids: tmp = get_node_func(page, obj_id, ele_only) - if tmp is False: - return False - elif tmp is not None: + if tmp is not None: return tmp return False