None of the solutions provided seemed at all easiest to me, so I'd like to add my own way.
Basically, you get the list of the elements instead of just the element and then count the results; if it's zero, then it doesn't exist. Example:
if driver.find_elements_by_css_selector('#element'):
print "Element exists"
Notice the "s" in find_elements_by_css_selector
to make sure it can be countable.
EDIT: I was checking the len(
of the list, but I recently learned that an empty list is falsey, so you don't need to get the length of the list at all, leaving for even simpler code.
Also, another answer says that using xpath is more reliable, which is just not true. See What is the difference between css-selector & Xpath? which is better(according to performance & for cross browser testing)?