title: Refreshing DOM so Selenium Web Driver can find element
body: <p>I'm trying to use Selenium's Chrome web driver to navigate to a page and then fill out a form. The problem is that the page loads and then 5 seconds later displays the form. So JavaScript changes the DOM after 5 seconds. I think this means that the form's html id doesn't exist in the source code the web driver receives.</p>
  
  <p>This is what the form looks like with Chrome's inspect feature:
  <a href="https://i.stack.imgur.com/dh4CY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dh4CY.png" alt="page element"></a></p>
  
  <p>However that html doesn't appear in the page's source html.</p>
  
  <p>Python used to find the element:</p>
  
  <pre><code>answerBox = driver.find_element_by_xpath("//form[@id='answer0problem2']")
  </code></pre>
  
  <p>How would I access the input field within this form?</p>
  
  <p>Is there a way to refresh the web driver without changing the page?</p>