This is my first time posting on stackoverflow, and I'm somewhat new to Selenium and Python.
I wan't a function to be runned when the URL is equal to fx: https://www.example.com.
I have read this answer in another discussion, but i didn't quite understand what was going on.
I hope you take the time to answer my question.
Ok, so i have just tried this:
driver.get('https://www.google.com')
time.sleep(4)
driver.get('https://www.stackoverflow.com')
if WebDriverWait(driver, 10).until(EC.url_to_be('https://stackoverflow.com')):
print('Desired url was rendered within allocated time')
else:
print('Desired url was not rendered within allocated time')
But it did not work. Any ideas?
The console says
Traceback (most recent call last):
File "/Users/holger/PycharmProjects/waitTest/wait.py", line 15, in <module>
if WebDriverWait(browser, 10).until(EC.url_to_be('https://www.stackoverflow.com')):
File "/Users/holger/PycharmProjects/waitTest/venv/lib/python3.8/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: