title: selenium web driver accessing list box values
body: <p>I am facing problem with Selenium web driver in accessing List box Values.</p>
  
  <p>Check the image:
  <a href="https://i.stack.imgur.com/fLjl8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fLjl8.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/fV4vS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fV4vS.png" alt="enter image description here"></a></p>
  
  <p>I am able to paste value and pass the class name of list which i want to select, basically i  have to select every time the very first option which is displayed in the list</p>
  
  <pre><code> 1   driver.get('https://my.maerskline.com/schedules/vessel')
   2   button = driver.find_element_by_id("s2id_b-vesselCode")   
   3   button.click()        
   4   button1 = driver.find_element_by_id("s2id_autogen1_search")
   5   button1.send_keys(Vessel_name)        
   6   button3 = driver.find_element_by_id("select2-results-dept-0 select2-result select2-result-selectable")
   7   button3.click()
   8   button2 = driver.find_element_by_id("schedulesByVesselSearchButton")
      button2.click()
  </code></pre>
  
  <p>Line 6 gives me below error</p>
  
  <pre><code>selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element:
  {"method":"id","selector":"select2-results-dept-0 select2-result
  select2-result-selectable"}   (Session info: chrome=55.0.2883.87)  
  (Driver info: chromedriver=2.26.436362 (5476ec6bf7ccbada1734a0cdec7d570bb042aa30),platform=Windows NT 6.1.7601 SP1 x86_64)
  </code></pre>
  
  <p>Any idea how I can get this done? Any more information needed let me know.  Thanks</p>
  
  <p>updated Code</p>
  
  <pre><code>if Vessel_name != "":
          #driver.get('https://my.maerskline.com/vessels?searchTerm={0}'.format(Vessel_name))
          print(Vessel_name)
  
          driver.get('https://my.maerskline.com/schedules/vessel')
          button = driver.find_element_by_id("s2id_b-vesselCode")   
          button.click()        
          button1 = driver.find_element_by_id("s2id_autogen1_search")
          button1.send_keys(Vessel_name)       
          button3 =driver.find_element_by_css_selector("#select2-results-1&gt;li:nth-child(1)")
          button3.click()
          #button2 = driver.find_element_by_id("schedulesByVesselSearchButton")
          #button2.click()
          try:
  
  
  
          soup = BeautifulSoup(driver.page_source)
  </code></pre>