title: Selenium - How to get text after image tag
body: <pre><code>&lt;ul class="meta"&gt;
     &lt;li class="user"&gt;
         &lt;img class="classname" src="some url"&gt;
         givemetext               
     &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to grab text "givemetext" by finding the element and using .getText(); The catch is thou I already grab a surrounding element and am doing something like this "</p>
  
  <pre><code>List&lt;WebElement&gt; user = i.findElements(By.xpath("../ul[@class='meta']/li[@class='user']"));
  System.out.println("username! " + user.get(0).getText());
  </code></pre>
  
  <p>'i' is the for each element that I already found. I also tried adding /img to the xpath but no text is found. Any direction be great! Thanks. This is java btw (If you couldn't see from System.out ;).</p>