title: How to grab just element id - using Selenium WebDriver 2
body: <p>EDIT:
  I also tried this</p>
  
  <pre><code> var webElements1 = (Driver.FindElements(By.XPath("//*[@id='ctl00_ContentPlaceHolder1_Control1_lstCategory']//input"))).ToList();
  </code></pre>
  
  <p>I get the empty Text</p>
  
  <p>I am trying to find a way to grab just ID from the list i am getting and below is my code and a print shot of my screen.</p>
  
  <p>//WebDriver getting a list of Text</p>
  
  <p>the below code returns me the correct number of records but it just give me the <code>Text</code> but I am after <code>Text</code> and <code>Id</code> of an particular <code>Text</code> </p>
  
  <p>I tried this:</p>
  
  <pre><code>var webElements1 = (Driver.FindElements(By.XPath("//*[@id='ctl00_ContentPlaceHolder1_Control1_lstCategory']/tbody/tr/td/span"))).ToList();
  </code></pre>
  
  <p>this</p>
  
  <pre><code>var webElements2 = (Driver.FindElements(By.XPath("//*[@id='ctl00_ContentPlaceHolder1_Control1_lstCategory']/tbody/tr/td"))).ToList();
  </code></pre>
  
  <p>and this...</p>
  
  <pre><code>var webElements3 = (Driver.FindElements(By.XPath("//*[@id='ctl00_ContentPlaceHolder1_Control1_lstCategory']"))).ToList();
  </code></pre>
  
  <p>the all code of line gives me the correct returns but without Id.</p>
  
  <p>Here is the print screen of my page:</p>
  
  <p><img src="https://i.stack.imgur.com/USL9J.png" alt="enter image description here"></p>