title: How to get the text only from the child element - Webdriver - Java
body: <p>I am trying to get the text only from a child element. See below:</p>
  
  <pre><code>&lt;strong class="EnvMain"&gt;
    &lt;strong id="currentClock"&gt;11:19&lt;/strong&gt;
    GMT
  &lt;/strong&gt;
  </code></pre>
  
  <p>I would like to get only the GMT text.</p>
  
  <p>I tried writing the xpath like: <code>.//*[@id='userEnvironmentInfo']/div[2]/a/strong/text()]</code> but this way the element is not found.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Update of HTML:</p>
  
  <pre><code>&lt;div class="DateTime"&gt;
   &lt;a class="EnvPicker" title="Change your timezone" href="javascript:void(0);"&gt;
    &lt;span class="EnvDD"&gt;▾&lt;/span&gt;
    &lt;span class="EnvIcon DateTimeIcon"&gt;The time is:&lt;/span&gt;
    &lt;strong class="EnvMain"&gt;
      &lt;strong id="currentClock"&gt;17:34&lt;/strong&gt;
      GMT
      &lt;/strong&gt;
    &lt;span id="currentDay" class="EnvMore"&gt;Monday&lt;/span&gt;
    &lt;span id="currentDate" class="EnvMore"&gt;14.04.2014&lt;/span&gt;
   &lt;/a&gt;
   &lt;div class="EnvContainer"&gt;
     &lt;ol id="timeZoneOptions" class="EnvList"&gt;
        &lt;li class="EnvItem"&gt;
           &lt;a class="EnvOption" title="Set the timezone to GMT-12" onclick="return false;" rel="-12" href="javascript:void(0);"&gt;
               &lt;strong class="EnvMain"&gt;GMT-12&lt;/strong&gt;
               &lt;span class="EnvMore"&gt;Current time:01:25&lt;/span&gt;
           &lt;/a&gt;
        &lt;/li&gt;
        &lt;li class="EnvItem"&gt;
           &lt;a class="EnvOption" title="Set the timezone to GMT-11" onclick="return false;" rel="-11" href="javascript:void(0);"&gt;
  </code></pre>
  
  <p>and here the elements will continue until GMT +12.</p>