title: More elegant way to write multiple try, except
body: <p>I am looking for a better way to write a multiple condition try-except statement,</p>
  <p>Actually I check for some condition &quot;A&quot; and if it fails, well I look for &quot;B&quot;,</p>
  <p>In this case I am trying 2 different scenarios for selenium webdriver. Sometimes I try more than 2 options</p>
  <pre><code>    try:
          message_button = WebDriverWait(self.driver, 20).until(
              EC.element_to_be_clickable((By.XPATH, '//button/div[contains(text(), &quot;Anybody&quot;)]')))
          return False
      except Exception as e:
          try:
              message_button = WebDriverWait(self.driver, 20).until(
                  EC.element_to_be_clickable((By.XPATH, '//span/div[contains(text(), &quot;Somebody&quot;)]')))
              return False
          except Exception as e:
              return &quot;yes&quot;
  </code></pre>
  <p>Also a way to look for both a at a time would be nice!</p>