您需要先导入异常
from selenium.common.exceptions import NoSuchElementException
然后你可以参考它
except NoSuchElementException: # handle the element not existing

您需要先导入异常
from selenium.common.exceptions import NoSuchElementException
然后你可以参考它
except NoSuchElementException: # handle the element not existing