title: Get the child of an HTML element by its XPath
body: <p>I have a really simple ask, i have a div in a html page that i can acces by his XPath which is : <code>//div[2]/div/div[2]/div[2]/div[2]</code>.</p>
  
  <p>I want a XPath that would give all the child of this div but i can't find it.
  I need to get the element with the findElements method of Selenium, but what i've tested does not work:</p>
  
  <p>My HTML code looks like this :</p>
  
  <pre><code>&lt;div&gt;
      &lt;input/&gt;
      &lt;span/&gt;
      &lt;p&gt;&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the XPath I want to use like this : </p>
  
  <pre><code>//div[2]/div/div[2]/div[2]/div[2]/child
  </code></pre>
  
  <p>And my Java Selenium script like this :</p>
  
  <pre><code>List&lt;WebElement&gt; listElement = driver.findElements(By.xpath(xpath));
  
  for(WebElement element : listElement) {
      System.out.println(element.getAttribute("id"));
  }
  </code></pre>
  
  <p>What XPath should I put to get the child of the <code>div</code>?</p>
  
  <p>EDIT 1: I did use the * and it's working, but when i count the number of element it prints me 6. Does the * consider the children of his children as his own children ??</p>