title: Get element text from this span using Selenium WebDriver and C#
body: <p>I have exhausted my mental resources and can't solve this puzzle. I am attempting to extract the text from the span with id = "lookupCount". I want the "9" from there, but no matter how hard I try, it doesn't work. Please help, below is the html.</p>
  
  <p>Just to be clear, i want the value of this text - "9"</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="addressSelectionDiv" style="width:330px; margin-left:0px; margin-top:40px; "&gt;
  &lt;table id="addressSelectionTable" align="center" width="100%" cellspacing="2" cellpadding="0"&gt;
  &lt;tbody&gt;
  &lt;tr style="height:15px;"&gt;
  &lt;td&gt;
  &lt;div id="App.ctl00_leftContent_addressSelection_validationLabel_Container" style="display:inline;"&gt;
  &lt;label id="ctl00_leftContent_addressSelection_validationLabel" class="x-label x-label-default x-border-box" for="" style="color:#981e32;font-size:1.0em;"&gt;
  &lt;img id="ext-gen1029" class="x-label-icon" src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" style="display: none;"/&gt;
  &lt;span id="ext-gen1030" class="x-label-value"/&gt;
  &lt;/label&gt;
  &lt;/div&gt;
  &lt;span id="lookups" style="visibility: hidden; float: right;"&gt;
  &lt;span id="lookupCount"&gt;9&lt;/span&gt;
  /
  &lt;span id="lookupLimit"&gt;100&lt;/span&gt;
  &lt;/span&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr valign="top"&gt;
  &lt;tr&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is what I tried</p>
  
  <ul>
  <li><code>var x = Driver.FindElement(By.Id("lookupCount")).Text</code>     returns ""</li>
  <li><code>var x = Driver.FindElement(By.Id("lookups")).Text</code> returns ""</li>
  <li>Neither of the objects above contain any information that leads me to the answer, even if I remove the .Text property.</li>
  <li>The 2 lines below returns "" in the [0]th element.</li>
  </ul>
  
  <p><code>ICollection&lt;IWebElement&gt; table = Driver.FindElements(By.Id("lookups"));
  List&lt;IWebElement&gt; elements = table.ToList();</code></p>
  
  <p>The one below returns this string:</p>
  
  <p><code>Search for Household Decisions by entering an address or ZIP code:\r\n\r\n AL\r\n AK\r\n AZ\r\n AR\r\n CA\r\n CO\r\n CT\r\n DC\r\n DE\r\n FL\r\n GA\r\n HI\r\n ID\r\n IL\r\n IN\r\n IA\r\n KS\r\n KY\r\n LA\r\n ME\r\n MD\r\n MA\r\n MI\r\n MN\r\n MS\r\n MO\r\n MT\r\n NE\r\n NV\r\n NH\r\n NJ\r\n NM\r\n NY\r\n NC\r\n ND\r\n OH\r\n OK\r\n OR\r\n PA\r\n RI\r\n SC\r\n SD\r\n TN\r\n TX\r\n UT\r\n VT\r\n VA\r\n WA\r\n WV\r\n WI\r\n WY
  </code></p>
  
  <p><code>ICollection&lt;IWebElement&gt; table = Driver.FindElements(By.Id("addressSelectionTable"));
  List&lt;IWebElement&gt; elements = table.ToList();</code></p>