mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
ele()去掉自动添加//功能
This commit is contained in:
parent
e31472613f
commit
480ecc101f
@ -149,8 +149,8 @@ class DriverPage(object):
|
|||||||
raise ValueError("Len of loc_or_ele must be 2 when it's a tuple.")
|
raise ValueError("Len of loc_or_ele must be 2 when it's a tuple.")
|
||||||
loc_or_ele = translate_loc(loc_or_ele)
|
loc_or_ele = translate_loc(loc_or_ele)
|
||||||
|
|
||||||
if loc_or_ele[0] == 'xpath' and not loc_or_ele[1].startswith(('/', '(')):
|
# if loc_or_ele[0] == 'xpath' and not loc_or_ele[1].startswith(('/', '(')):
|
||||||
loc_or_ele = loc_or_ele[0], f'//{loc_or_ele[1]}'
|
# loc_or_ele = loc_or_ele[0], f'//{loc_or_ele[1]}'
|
||||||
|
|
||||||
# 接收到DriverElement对象直接返回
|
# 接收到DriverElement对象直接返回
|
||||||
elif isinstance(loc_or_ele, DriverElement):
|
elif isinstance(loc_or_ele, DriverElement):
|
||||||
|
@ -108,8 +108,8 @@ class SessionPage(object):
|
|||||||
|
|
||||||
loc_or_ele = translate_loc(loc_or_ele)
|
loc_or_ele = translate_loc(loc_or_ele)
|
||||||
|
|
||||||
if loc_or_ele[0] == 'xpath' and not loc_or_ele[1].startswith(('/', '(')):
|
# if loc_or_ele[0] == 'xpath' and not loc_or_ele[1].startswith(('/', '(')):
|
||||||
loc_or_ele = loc_or_ele[0], f'//{loc_or_ele[1]}'
|
# loc_or_ele = loc_or_ele[0], f'//{loc_or_ele[1]}'
|
||||||
|
|
||||||
elif isinstance(loc_or_ele, SessionElement):
|
elif isinstance(loc_or_ele, SessionElement):
|
||||||
return loc_or_ele
|
return loc_or_ele
|
||||||
|
Loading…
x
Reference in New Issue
Block a user