Maximize WebDriver (Selenium 2) in Python

后端 未结 5 935
醉梦人生
醉梦人生 2021-02-05 06:03

I\'m attempting to write a simple script that checks if I have any gmail emails labeled SOMETHING and then opens a firefox browser window to a login page, after which it goes to

5条回答
  •  忘掉有多难
    2021-02-05 06:21

    There is a really simple way to create a maximized window:

    from selenium.webdriver.chrome.options import Options
    
    chrome_options = Options()
    # maximized window
    chrome_options.add_argument("--start-maximized")
    

    You can also use this library for maximizing the window and more, see the documentation: https://seleniumhq.github.io/selenium/docs/api/rb/Selenium/WebDriver/Chrome/Options.html

提交回复
热议问题