title: Need to know the Xpath expression for finding values of label tags in DOM
body: <pre><code>&lt;div id="content1customId" class="tabcontent" style="display: block;"&gt;
  &lt;table cellspacing="0" cellpadding="0" border="0" style="text-align: right; width: 100%;"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td height="25px"&gt;
  &lt;label style="color: red;"&gt; * &lt;/label&gt;
  &lt;label title="INGRESE TIPO DE DOCUMENTO"&gt;Tipo De Documento   &lt;/label&gt;
  &lt;/td&gt;
  &lt;td align="left"&gt;
  &lt;td align="left"&gt;
  &lt;td&gt;
  &lt;td align="left"&gt;
  &lt;td align="left"&gt;
  </code></pre>
  
  <p>This is the DOM structure present above in which I need to find ALL the "label" tags having attribute "title" so that I can further extract the attribute's value. For example: </p>
  
  <pre><code>&lt;label title="INGRESE TIPO DE DOCUMENTO"&gt;Tipo De Documento   &lt;/label&gt;
  </code></pre>
  
  <p>I want to extract "Tipo De Documento" text from the above for which I am writing a xpath i.e. <code>//label[@title]</code>.</p>
  
  <p>and then using in my code like this:</p>
  
  <pre><code>List&lt;WebElement&gt; dvLable = driver.findElements(By.xpath("//label[title]"));
  
  for (WebElement dvl : dvLable) {
          String tdLabName = dvl.getText();
          System.out.println("This is label: " + tdLabName);
      }
  </code></pre>
  
  <p>Similarly, I want to find such 'text' value for all the labels presented across the page DOM.</p>