I'm new to this forum as well as to programming and selenium. I'm trying to maximize my chrome browser using selenium python(using the below code) and everytime selenium opens the browser it would not maximize the whole window.It maximizes only half the screen with "data:," already filled on the address bar.
self.driver = webdriver.Chrome()
self.driver.maximize_window()
I also tried
options=webdriver.ChromeOptions()
options.add_argument("--start-maximized")
driver=webdriver.Chrome(chrome_options=options)
but doesn't help
Just looked at my code and noticed that my import is
from selenium.webdriver.chrome.options import Options
And the rest of the code is
options = Options()
options.add_argument("--start-maximized")
driver=webdriver.Chrome(chrome_options=options)
This does work
There is an open issue in ChromeDriver which is specific to Mac OS X.
What I remember helped was to first set the dimensions explicitly and then maximize:
driver.set_window_size(1200, 800)
driver.maximize_window()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With