title: How to select value from search dropdown In selenium
body: <p>I need to import all the values from a dropdown menu to combobox in my GUI .</p>
  
  <p>After that I need to select a value by click on combobox. </p>
  
  <p>but it did not work.
  Please help me with selecting a value from the dropdown. 
  How do i get all text values available in the dropdown ?</p>
  
  <pre class="lang-py prettyprint-override"><code>
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  from selenium.webdriver.common.by import By
  from selenium.common.exceptions import TimeoutException
  from PyQt5.QtWidgets import QApplication
  from selenium import webdriver
  from selenium.webdriver.support.ui import Select
  from selenium.common.exceptions import StaleElementReferenceException
  from selenium.webdriver.common.keys import Keys
  from PyQt5 import QtCore, QtGui, QtWidgets
  from PyQt5.QtGui import QIcon, QPixmap
  import time
  import os
  
      def first(self):
  
          url = 'https://www....aspx'
          driver = webdriver.Chrome(executable_path="chromedriver.exe")
          driver.get(url)
          s1 = Select(driver.find_element_by_id('select2-ctl00_PlaceHolderMain_oDistributionUC_ddlClass-container'))
  
          all_options = s1.options
          for options in all_options:
              self.comboBoxClass.addItem(options.text)
              print(options.text)
  
          self.comboBoxClass.activated.connect(self.loading_2)
  
      def loading_2(self):
          s1.select_by_visible_text(str(self.comboBoxClass.currentText()))
  </code></pre>
  
  <p>HTML code:</p>
  
  <pre class="lang-html prettyprint-override"><code>
  
  
  &lt;div id="ctl00_PlaceHolderMain_oDistributionUC_oClassUpdatePanel"&gt;
  
          &lt;div id="ctl00_PlaceHolderMain_oDistributionUC_trEmptyRow" class="col-xs-12 no_padding"&gt;
              &lt;div class="col-xs-5 col-sm-4"&gt;
                  &lt;span class="manditory"&gt;&lt;/span&gt;
              &lt;/div&gt;
  
              &lt;div class="col-xs-7 col-sm-8 feild_data"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div id="ctl00_PlaceHolderMain_oDistributionUC_trClass" class="col-xs-12 no_padding"&gt;
              &lt;div class="col-xs-5 col-sm-4 feild_title divDistributionSearchTitle"&gt;
                  &lt;span id="ctl00_PlaceHolderMain_oDistributionUC_tdStar04" class="manditory"&gt;*&lt;/span&gt;
                  &lt;span id="ctl00_PlaceHolderMain_oDistributionUC_lblClass" class="StandardFont" style="display:inline-block;width:120px;"&gt;class&lt;/span&gt;
              &lt;/div&gt;
  
              &lt;div class="col-xs-7 col-sm-8 feild_data divDistributionSearchData"&gt;
                  &lt;select name="ctl00$PlaceHolderMain$oDistributionUC$ddlClass" onchange="javascript:setTimeout(&amp;#39;__doPostBack(\&amp;#39;ctl00$PlaceHolderMain$oDistributionUC$ddlClass\&amp;#39;,\&amp;#39;\&amp;#39;)&amp;#39;, 0)" id="ctl00_PlaceHolderMain_oDistributionUC_ddlClass" class="control-dropdownlist" style="width:100%;"&gt;
              &lt;option selected="selected" value="-99"&gt;-- chose --&lt;/option&gt;
              &lt;option value="1,1"&gt;good1 &lt;/option&gt;
              &lt;option value="2,1"&gt;good2 &lt;/option&gt;
              &lt;option value="3,1"&gt;good3 &lt;/option&gt;
              &lt;option value="4,1"&gt;good4 &lt;/option&gt;
              &lt;option value="5,1"&gt;good5 &lt;/option&gt;
              &lt;option value="6,1"&gt;good6 &lt;/option&gt;
  
          &lt;/select&gt;
  
  
  
                  &lt;div id="ctl00_PlaceHolderMain_oDistributionUC_tdValidatorClass"&gt;
                      &lt;div id="ctl00_PlaceHolderMain_oDistributionUC_oUpdatePanelrfvClass"&gt;
  
                              &lt;span id="ctl00_PlaceHolderMain_oDistributionUC_rfvClass" class="ValidationClass" style="display:inline-block;width:100px;display:none;"&gt; chose class.&lt;/span&gt;
  
  
  
  </code></pre>
  
  <p>value like good1,good2,good3,...</p>
  
  <p>update:</p>
  
  <p>Thanks NitishKshirsagar
  this is working now:</p>
  
  <pre class="lang-py prettyprint-override"><code>drop_down = driver.find_element_by_css_selector('#ctl00_PlaceHolderMain_oDistributionUC_trClass .divDistributionSearchData')
  
  ActionChains(driver).move_to_element(drop_down).perform()
  drop_down.click()
  drop_down = driver.switch_to.active_element
  
  element = driver.find_element_by_css_selector("#ctl00_PlaceHolderMain_oDistributionUC_trClass .divDistributionSearchData select")
  all_options = element.find_elements_by_tag_name("option")
  for option in all_options:
      print(option.text)
  
  
  
  </code></pre>