mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
获取到的css_path前面加上:root,适配新版
This commit is contained in:
parent
7ec51417ce
commit
6094238f60
@ -192,7 +192,8 @@ class DriverElement(DrissionElement):
|
||||
}
|
||||
return e(arguments[0]);
|
||||
'''
|
||||
return self.run_script(js)
|
||||
res_txt = self.run_script(js)
|
||||
return f':root{res_txt}' if mode == 'css' else res_txt
|
||||
|
||||
# -----------------driver独有属性和方法-------------------
|
||||
@property
|
||||
|
@ -158,9 +158,9 @@ class SessionElement(DrissionElement):
|
||||
brothers = len(ele.eles(f'xpath:./preceding-sibling::{ele.tag}'))
|
||||
path_str = f'/{ele.tag}[{brothers + 1}]{path_str}' if brothers > 0 else f'/{ele.tag}{path_str}'
|
||||
|
||||
ele = ele.parent
|
||||
ele = ele.parent()
|
||||
|
||||
return path_str[1:] if mode == 'css' else path_str
|
||||
return f':root{path_str[1:]}' if mode == 'css' else path_str
|
||||
|
||||
# ----------------session独有方法-----------------------
|
||||
def _make_absolute(self, link) -> str:
|
||||
|
Loading…
x
Reference in New Issue
Block a user