ele()去掉自动添加//功能

This commit is contained in:
g1879 2020-11-26 17:26:55 +08:00
parent e31472613f
commit 480ecc101f
2 changed files with 4 additions and 4 deletions

View File

@ -149,8 +149,8 @@ class DriverPage(object):
raise ValueError("Len of loc_or_ele must be 2 when it's a tuple.")
loc_or_ele = translate_loc(loc_or_ele)
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]}'
# 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]}'
# 接收到DriverElement对象直接返回
elif isinstance(loc_or_ele, DriverElement):

View File

@ -108,8 +108,8 @@ class SessionPage(object):
loc_or_ele = translate_loc(loc_or_ele)
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]}'
# 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]}'
elif isinstance(loc_or_ele, SessionElement):
return loc_or_ele