title: How to get selected option using Selenium WebDriver with Python?
body: <p>How to get selected option using Selenium WebDriver with Python:</p>
  
  <p>Someone have a solution for a <code>getFirstSelectedOption</code>?</p>
  
  <p>I'm using this to get the select element:</p>
  
  <pre><code>try:
      FCSelect = driver.find_element_by_id('FCenter')
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Verify Form Elements: F Center Select found"
  except NoSuchElementException:
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Error: Select FCenter element not found"
  </code></pre>
  
  <p>Is there an equivalent or something close to 'getFirstSelectedOption' like this:</p>
  
  <pre><code>try:
      FCenterSelectedOption = FCenterSelect.getFirstSelectedOption()
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Verify Form Elements: F Center Selected (First) found"
  except NoSuchElementException:
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Error: Selected Option element not found"
  </code></pre>
  
  <p>Then I would like to Verify the Contents with a <code>getText</code> like:</p>
  
  <pre><code>try:
      FCenterSelectedOptionText = FCenterSelectedOption.getText()
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Verify Form Elements: FCenter Selected Option Text found"
  except NoSuchElementException:
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Error: Selected Option Text element not found"
  
  if FCenterSelectedOptionText == 'F Center Option Text Here':
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Verify Form Elements: F Center Selected Option Text found"
  else:
      self.TestEventLog = self.TestEventLog + "&lt;br&gt;Error: F Center 'Selected' Option Text not found"
  </code></pre>