title: How to extract text from webdriver elements found through xpath using Selenium and Python
body: <p>I have working code:</p>
  
  <pre><code>options_elements = issn_dropdown.find_elements_by_xpath("//ul[contains(@id,'my_id')]//li")
  options = [x.text for x in options_elements]
  </code></pre>
  
  <p><code>options_elemets</code> is an array of 5 <code>selenium.webdriver.remote.webelement.WebElement</code>, each of them contains <code>text</code>. The result <code>option</code> is exactly what I need. Why can't I change it to:</p>
  
  <pre><code>options = issn_dropdown.find_elements_by_xpath("//ul[contains(@id,'my_id')]//li/text()")
  </code></pre>
  
  <p>? Test just fails on this line with no particular error displayed.</p>