title: How to print and Click all the child elements in list though Selenium Webdriver in Python
body: <p>I have one Element "Sectors", when hover to Sector in drop down we have different child elements in list.
  and i want to print all the elements in the list and also click all the element in Python.basically I want to make it dynamic so that in future if any child element is added r deleted so it wont effect my script.
  I have written my selenium script but unable to print elements.</p>
  
  <pre><code>from selenium import webdriver
  import selenium.webdriver.common.action_chains
  
  
  
  element_to_hover_over = driver.find_element_by_id("mnu_Sectors")
  hover = selenium.webdriver.common.action_chains.ActionChains(driver).move_to_element(element_to_hover_over)
  hover.perform()
  
  
  list = driver.find_elements_by_css_selector("#mnu_Sectors &gt; ul &gt; li")
  for value in list:
   print(value)
   driver.find_elements_by_css_selector(value).click()
  </code></pre>
  
  <p>and in result am i getting this :</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/maham/PycharmProjects/Test/script.py", line 26, in &lt;module&gt;
      driver.find_elements_by_css_selector(value).click()
    File "C:\Users\maham\PycharmProjects\Test\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 613, in find_elements_by_css_selector
      return self.find_elements(by=By.CSS_SELECTOR, value=css_selector)
    File "C:\Users\maham\PycharmProjects\Test\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 995, in find_elements
      'value': value})['value'] or []
    File "C:\Users\maham\PycharmProjects\Test\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
      self.error_handler.check_response(response)
    File "C:\Users\maham\PycharmProjects\Test\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
      raise exception_class(message, screen, stacktrace)
  selenium.common.exceptions.WebDriverException: Message: invalid argument: 'value' must be a string
    (Session info: chrome=68.0.3440.75)
    (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)
  
  
  Process finished with exit code 1
  </code></pre>
  
  <p>The HTML code is </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;li id="mnu_Sectors" onmouseover="javascript:onMenuNavHover(this);" onmouseout="javascript:onMenuOnBlur();" class="fl-menu"&gt;
                      &lt;a menu-item="javascript:void(0)" href="javascript:void(0)"&gt;Sectors
                              &lt;i class="arrow"&gt;&lt;/i&gt;
                      &lt;/a&gt;
                          &lt;ul class="holder-full" style="display: none;" onmouseover="javascript:onSubMenuNavHover();"&gt;
                              &lt;li&gt;
                                      &lt;a menu-item="/en/sector/bank/sectorid/4" href="/en/sector/bank/sectorid/4" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Banks&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/cement/sectorid/6" href="/en/sector/cement/sectorid/6" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Cement&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/petrochemicals/sectorid/33" href="/en/sector/petrochemicals/sectorid/33" class="lock-menu-icon"&gt;&lt;i class="arrow lock-menu-icon"&gt;&lt;/i&gt;Petrochemicals&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/insurance/sectorid/2/" href="/en/sector/insurance/sectorid/2/" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Insurance&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/telecom/sectorid/52" href="/en/sector/telecom/sectorid/52" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Telecom &amp;amp; IT&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/healthcare/sectorid/218/true" href="/en/sector/healthcare/sectorid/218/true" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Health Care&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/real-estate-development/sectorid/44/" href="/en/sector/real-estate-development/sectorid/44/" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Real Estate Development&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/hotels-and-tourism/sectorid/36" href="/en/sector/hotels-and-tourism/sectorid/36" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;Hotels &amp;amp; Tourism&lt;/a&gt;
                                      &lt;a menu-item="/en/sector/reits/sectorid/78" href="/en/sector/reits/sectorid/78" class=""&gt;&lt;i class="arrow "&gt;&lt;/i&gt;REITs&lt;/a&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
                  &lt;/li&gt;</code></pre>
  </div>
  </div>
  </p>