title: How to get total count of div tags inside a div tag using python selenium webdriver
body: <p>I am testing a script to find the number of div tags inside a div tag, reason to do this...is to get the last div number ( div[last div] ) inside a full path.</p>
  
  <p>full path of div is like :</p>
  
  <pre><code>full_path = '//*[@id="main"]/div[2]/div/div # continue line
  /div[2]/div[i want the total div count here]/div/ # continue line
  div/div[2]/div/div'
  </code></pre>
  
  <p>split the path to 4 section</p>
  
  <pre><code>full_path = '//*[@id="main"]/div[2]/div/div/div[2]/div[14]/div/div/div[2]/div/div'
  
  half_path1 = '//*[@id="main"]/div[2]/div/div/div[2]'
  
  half_path_with_slash = '//*[@id="main"]/div[2]/div/div/div[2]/'
  
  second_half_path = '/div/div/div[2]/div/div'
  
  
  print ('going to search')
  
  test_path = wait.until(EC.presence_of_element_located((By.XPATH,half_path)))
  
  count = driver.select_list(:id=&gt; 'div').options.count
  
  print ('searching')
  
  print (count) # not working
  </code></pre>
  
  <p>so i tried something like this :</p>
  
  <pre><code>    waitof = WebDriverWait(driver = driver, timeout = 9)
  
      array = [] # to collect the div count
  
      for i in array:
  
          test_path = waitof.until(EC.presence_of_element_located((By.XPATH,half_path1)))
          print('div loaded')
  
          test_pathx = driver.find_element_by_xpath(slash_path)
          array.append(text_pathx)
          print ('first loop')
          for i in test_pathx:
              print ('second loop')
              loop_path = driver.find_element_by_xpath(just_path1 +'div[%d]' % (i))
              div_elements.append[i]
              print(div_elements[i])
  
      awesome_full_path = ('//*[@id="main"]/div[2]/div/div/div[2]/div[%d]
  /div/div/div[2]/div/div' % div_elements)
  </code></pre>
  
  <p>its not working please help!!!
  if the question is not clear please comment (new here)</p>