I'm trying to check the .readyState of a website using .execute_script but I keep getting an error.
I'm using a pageLoadStrategy of "none" in chromedriver so I'm trying to test that the websites readystate is no longer "loading".
Note: this question is Python-specific.
WebDriverWait(driver, timeout=20).until(
driver.execute_script('return document.readyState') == 'interactive'
)
value = method(self._driver) TypeError: 'str' object is not callable
I've also tried using lambda which doesn't throw an error, however printing the readystate will return conflicting results.
WebDriverWait(driver, timeout=20).until(
lambda driver: driver.execute_script('return document.readyState') == 'interactive'
)
print(driver.execute_script('return document.readyState'))
loading