Does anyone have a cleaner way to handle exceptions in Python?
Currently I frequently have this pattern in my code
try:
#some code that throws an exception
except:
pass #because I don't really need to handle anything in this case
Is there a way just to catch the exception without doing this? Any Suggestions?
In this specific case, I am using selenium and depending on if a page element is there or not I need to execute some code. If it's not there, an exception is thrown but the code may continue. I simply am seeing if there is a cleaner way to handle this :)