python selenium selenium.common.exceptions.StaleElementReferenceException error
<p>I have the below code </p>

<pre><code>from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

driver = webdriver.Firefox()

driver.get("https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa")
username = WebDriverWait(driver, 20).until(lambda driver : driver.find_element_by_id('appleId'))
password = WebDriverWait(driver, 20).until(lambda driver : driver.find_element_by_id('pwd'))

username.send_keys("xxxxxxxxxx.com")
password.send_keys("xxxxxxxx")

password.submit()
</code></pre>

<p>But i got the below error</p>

<pre><code>password.submit()
File "/Users/.virtualenvs/itunes/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 84, in submit
    self._execute(Command.SUBMIT_ELEMENT)
  File "/Users/.virtualenvs/itunes/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 457, in _execute
    return self._parent.execute(command, params)
  File "/Users/.virtualenvs/itunes/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 233, in execute
    self.error_handler.check_response(response)
  File "/Users/.virtualenvs/itunes/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.StaleElementReferenceException: Message: Element not found in the cache - perhaps the page has changed since it was looked up
Stacktrace:
    at fxdriver.cache.getElementAt (resource://fxdriver/modules/web-element-cache.js:9454)
    at Utils.getElementAt (file:///var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/tmpR5A61x/extensions/fxdriver@googlecode.com/components/command-processor.js:9039)
    at WebElement.submitElement (file:///var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/tmpR5A61x/extensions/fxdriver@googlecode.com/components/command-processor.js:12156)
    at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/tmpR5A61x/extensions/fxdriver@googlecode.com/components/command-processor.js:12661)
    at fxdriver.Timer.prototype.setTimeout/&lt;.notify (file:///var/folders/x1/1bwt313j0qvgdh5pfzpbpvcw0000gn/T/tmpR5A61x/extensions/fxdriver@googlecode.com/components/command-processor.js:625)
</code></pre>

<p>Any ideas what's wrong ?</p>