title: how to get all child elements of a parent in selenium vba?
body: <pre><code>Option Explicit
  
  Sub ex()
  Dim htmldoc As MSHTML.HTMLDocument
  
  Dim htmldiv As Selenium.WebElement
  Dim htmlul As Selenium.WebElement
  Dim htmlAs As Selenium.WebElements
  Dim htmlA As Selenium.WebElement
  Dim htmlTable As Selenium.WebElement
  Dim TableSection As Selenium.WebElement
  
  Dim TableName As String
  
  URL = &quot;https://www.whoscored.com/Statistics&quot;
  
  sel.Start &quot;Chrome&quot;
  sel.Get URL
   
  Set htmldiv = sel.FindElementById(&quot;top-player-stats&quot;)
  Set htmlul = sel.FindElementById(&quot;top-player-stats-options&quot;)
  
  Set htmlAs = htmlul.FindElementsByTag(&quot;a&quot;)
  
      For Each htmlA In htmlAs
          TableName = Right(htmlA.Attribute(&quot;href&quot;), Len(htmlA.Attribute(&quot;href&quot;)) - InStr(1, htmlA.Attribute(&quot;href&quot;), &quot;#&quot;))
          htmlA.Click
          
  Set htmlTable = sel.FindElementById(TableName &amp; &quot;-grid&quot;)
      
      For Each TableSection In htmlTable.FindElementsByXPath(&quot;//*[@id=&quot;&quot;top-player-stats-summary-grid&quot;&quot;]&quot;)
          'Debug.Print htmlTable.FindElementsByXPath(&quot;//*[@id=&quot;&quot;top-player-stats-summary-grid&quot;&quot;]&quot;).Count
          debug.print TableSection.tagname
  
      Next TableSection
  
      Next htmlA
  End Sub
  </code></pre>
  <p>here htmltable.findelementsbyxpath... gives only one element i.e. table tag itself, but i want to loop through all children of htmltable, so how to do that.whether my xpath method is correct?</p>