title: Python Selenium Check if .click() was clickable or not
body: <p>I would like to use an if function that tells me whether a button has been clicked or not in my code given below, if yes then &quot;a&quot; should be output if no then &quot;b&quot;.</p>
  <pre><code>element = driver.find_element(By.XPATH, '//*[contains(concat( &quot; &quot;, @class, &quot; &quot; ), concat( &quot; &quot;, &quot;css-xf3ahq&quot;, &quot; &quot; ))][text()=&quot;Button&quot;]')
  element.click()
  
  if element == True:
      print(&quot;a&quot;)
  
  else:
      print(&quot;b&quot;)
  
  </code></pre>
  <p>up to now b has always been written although the button is clickable</p>