微调逻辑

This commit is contained in:
g1879 2021-12-24 11:37:30 +08:00
parent b6f2945aec
commit 4dd9c2a12e

View File

@ -138,7 +138,11 @@ class ShadowRootElement(BaseElement):
:return: DriverElement对象
"""
# 先转换为sessionElement再获取所有元素获取它们的css selector路径再用路径在页面上执行查找
eles = make_session_ele(self.html).eles(loc_or_str)
loc = get_loc(loc_or_str)
if loc[0] == 'css selector' and str(loc[1]).startswith(':root'):
loc = loc[0], loc[1][5:]
eles = make_session_ele(self.html).eles(loc)
if not eles:
return None if single else []