I've been messing around with python/selenium a bit, now I got to use the "try" method. I want the driver to wait until it maximized the window, and then go on with the code. At the beginning it just went on executing all scripts and the chrome window got maximized whilst executing it, which looked pretty weird. Anyways I hope you can help me, Have a good day y'all ;))
Ah, here's the code: (And the error message beneath it)
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome(executable_path=r'C:\Users\Anyone\Desktop\Python\chromedriver.exe')
print("Automation Started, please hold on.")
driver.get("https://blablabla")
try:
recap = WebDriverWait(driver, 5).until(
EC.WebDriverException(driver.maximize_window())
)
finally:
driver.forward()
And here's the error message:
Traceback (most recent call last):
File "C:/Users/Anyone/PycharmProjects/blebleble/blablabla.py", line 17, in <module>
EC.WebDriverException(driver.maximize_window())
File "C:\Users\Anyone\PycharmProjects\blablabla\venv\lib\site-packages\selenium\webdriver\support\wait.py", line 71, in until
value = method(self._driver)
TypeError: 'WebDriverException' object is not callable