Unable to catch Selenium NoSuchElementException

Maybe I am missing something very basic here, but my "except" block doesn't catch the exception it's intended for when using selenium. For example:

from selenium.common.exceptions import NoSuchElementException

except NoSuchElementException:

This still breaks with a NoSuchElementException if the element isn't there. How is this possible?

Read more here: https://stackoverflow.com/questions/68482053/unable-to-catch-selenium-nosuchelementexception

Content Attribution

This content was originally published by Overflow_101 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: