📅  最后修改于: 2022-03-11 14:48:12.206000             🧑  作者: Mango
from selenium.common.exceptions import NoSuchElementException
def check_exists_by_xpath(xpath):
try:
webdriver.find_element_by_xpath(xpath)
except NoSuchElementException:
return False
return True