Home > Software engineering >  Selenium does not open windows as maximized
Selenium does not open windows as maximized

Time:10-16

I need to open the maximized page, but selenium does not work. It just opens the page usually.

from selenium.webdriver.chrome.options import Options    
options = Options()
options.add_argument("--start-maximized")
driver = webdriver.Chrome(executable_path=r'/Users/chromedriver', options=options)

CodePudding user response:

Do you mean --start-fullscreen?

CodePudding user response:

You should try this options.add_argument("window-size=1920,1080")

CodePudding user response:

Per this post How to maximize chrome browser in default when using selenium in python you can try chrome_options.add_argument("--start-maximized") and depending on your version of chromedriver, it's worth reading through this post: How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?

driver.maximize_window() also seems to be an option to try.

  • Related