def element_is_exists(
self,
selector: str = None,
max_timeout: int = 10,
inner_text=None,
text_contains=None,
value=None,
xpath: str = None,
) -> bool:
"""
查询元素是否存在
:param selector:
:param max_timeout: 超时时间
:param inner_text: inner_text
:param value: value
:param text_contains: 包含的文字
:param xpath: 使用xpath
:return: bool
"""
if selector and selector.startswith("/"):
# 以/或//开头的认为是xpath
xpath = selector
selector = None
return self._wait(
lambda: self._element_is_exists(
selector, xpath, inner_text=inner_text, value=value, text_contains=text_contains
),
max_timeout,
)
如果使用了带()的xpath,这个方法就走selector了,存在问题的吧
直接传xpath了只能