From f2e147a7e2be398929e0ccac0c5300bf29560308 Mon Sep 17 00:00:00 2001 From: g1879 Date: Mon, 1 Jan 2024 23:34:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dis=5Fdisplayed=E5=B0=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/_units/states.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DrissionPage/_units/states.py b/DrissionPage/_units/states.py index 2abbcf5..9736a33 100644 --- a/DrissionPage/_units/states.py +++ b/DrissionPage/_units/states.py @@ -27,9 +27,8 @@ class ElementStates(object): @property def is_displayed(self): """返回元素是否显示""" - return not (self._ele.style('visibility') == 'hidden' - or self._ele.run_js('return this.offsetParent === null;') - or self._ele.style('display') == 'none') + return not (self._ele.style('visibility') == 'hidden' or self._ele.run_js('return this.offsetParent === null;') + or self._ele.style('display') == 'none' or self._ele.prop('hidden')) @property def is_enabled(self):