Selenium Webdriver: How to wait until document.readyState set to 'complete'?
<p>I'm using Selenium Webdriver in my code to run Firefox instance, and I have some timing issues.
Seems that my code starts to run before the page fully loaded.</p>

<p>How can I stop the code execution until my Webdriver instance loads the whole page?</p>

<p>example of my code:</p>

<pre><code>browser = webdriver.Firefox()
browser.get('https://google.com')
example_result = browser.execute_script('some_script')
</code></pre>

<p>In this example, the example_result will be set before the page fully loaded.
How can I wait until the page readyState will change to "complete"?</p>