diff --git a/DrissionPage/driver_page.py b/DrissionPage/driver_page.py index dd3b18c..2560dd3 100644 --- a/DrissionPage/driver_page.py +++ b/DrissionPage/driver_page.py @@ -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): diff --git a/DrissionPage/session_page.py b/DrissionPage/session_page.py index 1779ee2..a0c3c5e 100644 --- a/DrissionPage/session_page.py +++ b/DrissionPage/session_page.py @@ -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