title: How to traverse each dropdown list using selenium WebDriver python
body: <p>I have the web result with the html tags as below, I need to loop each value and get the results from the table</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;div class = "divList"&gt;
  &lt;select class="form selectList"&gt;
  &lt;option value="3710"&gt;Thu, 04 Nov 2021&lt;/option&gt;
  &lt;option value="3709"&gt;Mon, 01 Nov 2021&lt;/option&gt;
  &lt;option value="3708"&gt;Mon, 01 Nov 2021&lt;/option&gt;
  ....
  &lt;/select&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <pre><code>dropdownlist = driver.find_element_by_class_name('divList')
  valueslist = (dropdownlist.text).splitlines()
  print(valueslist)
  sel = Select(driver.find_element_by_xpath(&quot;//select[@class='form selectList']&quot;))
  for value in valueslist:
     print(value)
     sel.select_by_visible_text(value)
     print('Processing - ', value)
     time.sleep(3)
  </code></pre>
  <p>Getting the below error while changing the value after 2 iteration</p>
  <pre><code>Thu, 04 Nov 2021
  Processing -  Thu, 04 Nov 2021
  Mon, 01 Nov 2021
  Processing -  Mon, 01 Nov 2021
  Thu, 28 Oct 2021
  </code></pre>
  <p>selenium.common.exceptions.StaleElementReferenceException: Message: stale element   reference: element is not attached to the page document</p>