title: How to select a value from a drop-down using Selenium and Python
body: <p>I want to select an option from a select field using Selenium &amp; Python.</p>
  
  <p>The HTML is as follows:</p>
  
  <pre><code>&lt;select autocomplete="off" class="style_input_item" name="AccountEnable" id="Enable" value="0" onchange="onPageDataChange()"&gt;
      &lt;option value="0" selected="selected"&gt;&lt;script&gt;T("Disabled")&lt;/script&gt;Disabled&lt;/option&gt;
      &lt;option value="1"&gt;&lt;script&gt;T("Enabled")&lt;/script&gt;Enabled&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And I tried as follows:</p>
  
  <pre><code>driver.find_element_by_xpath('//*[@id="Enable"]/option[value="1"]').click()
  </code></pre>
  
  <p>I received that error:</p>
  
  <blockquote>
    <p>selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="Enable"]/option[value="0"]"}</p>
  </blockquote>