title: Selecting a value from drop down with span id in Selenium PYTHON
body: <p>I have been trying this for a while and searched different forums but I couldn't find any snippet to do this. </p>
  
  <p>I have a report in which options need to be selected through dropdown using Selenium in python. Below is the HTML structure</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div align="center"&gt; Select Fruit&lt;/div&gt;
  &lt;p align="center"&gt;&lt;br&gt;
   &lt;span id="0e6b87875e914a5f8d72bbee6844bea3" style="color: black; font-family: Arial; font-size: 13px; font-weight: normal; font-style: normal; width: 113px; display: inline-block;" class="sf-element sf-element-control sfc-property sfc-dropdown"&gt;
    &lt;div class="sf-element sf-element-dropdown" title="" style="position: relative; width: 100px;"&gt;
    &lt;div class="sf-element sf-element-icon" style="position: absolute; top: 1px; left: 91px; height: 17px; width: 17px;"&gt;
     &lt;svg width="17px" height="17px"&gt;&lt;path d="M4,6 l7,0 l-3.5,3.5 z" fill="currentColor" stroke-width="1" transform="scale(1.1333333333333333,1.1333333333333333)" class="Down"&gt;&lt;/path&gt;&lt;/svg&gt;
    &lt;/div&gt;
    &lt;div class="sf-element sf-element-text-box" style="display: inline-block; word-wrap: break-word; width: 83px;"&gt;(None)&lt;/div&gt;
     &lt;select class="sf-dropdown-select" style="color: rgb(0, 0, 0); font-family: Arial; background-color: rgb(248, 248, 248);"&gt;
      &lt;option value="0" selected="selected"&gt;(None)&lt;/option&gt;
      &lt;option value="1"&gt;Apple&lt;/option&gt;
      &lt;option value="2"&gt;Mango&lt;/option&gt;
      &lt;option value="3"&gt;Grapes&lt;/option&gt;
     &lt;/select&gt;
    &lt;/div&gt;
   &lt;/span&gt;&lt;br&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have tried different ways using css selector and XPath but nothing seems to work. Below is the code I tried </p>
  
  <pre><code>driver.find_element_by_xpath('//*[@id="0e6b87875e914a5f8d72bbee6844bea3"]/div/select/option[@value = "Mango"]')
  </code></pre>
  
  <p>Also different variants like options[2] and using css selector but it always give NoSuchElementException. </p>
  
  <p>Can someone please share some insights on this? </p>
  
  <p>Thanks</p>