This commit is contained in:
g1879 2024-07-12 20:12:27 +08:00
parent 54ee00f4b0
commit d2bf4f8f13

View File

@ -359,7 +359,8 @@ class ChromiumElement(DrissionElement):
:param timeout: 超时时间为None使用所在页面设置
:return: 元素对象
"""
if locator and not locator.startswith(('x:', 'xpath:', 'x=', 'xpath=', 'c:', 'css:', 'c=', 'css=')):
if locator and not (isinstance(locator, str) and not locator.startswith(
('x:', 'xpath:', 'x=', 'xpath=', 'c:', 'css:', 'c=', 'css='))):
raise ValueError('locator参数只能是str格式且不支持xpath和css形式。')
if x == y is None: