Skip to main content
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

The page at https://developer.mozilla.org/en-US/Firefox/Headless_modeThis page lists the --window-size=x,y which you can add with opts.add_argument("--window-size=1900,1080").

Complete example which works with latest firefox v57b8 (assumes you have geckodriver somewhere in your $PATH):

    caps = webdriver.DesiredCapabilities().FIREFOX
    opts = FirefoxOptions()
    opts.add_argument("-headless")
    opts.add_argument("--window-size=1900,1080")
    caps["marionette"] = True
    driver = webdriver.Firefox(capabilities=caps, firefox_options=opts)

The page at https://developer.mozilla.org/en-US/Firefox/Headless_mode lists the --window-size=x,y which you can add with opts.add_argument("--window-size=1900,1080").

Complete example which works with latest firefox v57b8 (assumes you have geckodriver somewhere in your $PATH):

    caps = webdriver.DesiredCapabilities().FIREFOX
    opts = FirefoxOptions()
    opts.add_argument("-headless")
    opts.add_argument("--window-size=1900,1080")
    caps["marionette"] = True
    driver = webdriver.Firefox(capabilities=caps, firefox_options=opts)

This page lists the --window-size=x,y which you can add with opts.add_argument("--window-size=1900,1080").

Complete example which works with latest firefox v57b8 (assumes you have geckodriver somewhere in your $PATH):

    caps = webdriver.DesiredCapabilities().FIREFOX
    opts = FirefoxOptions()
    opts.add_argument("-headless")
    opts.add_argument("--window-size=1900,1080")
    caps["marionette"] = True
    driver = webdriver.Firefox(capabilities=caps, firefox_options=opts)
added 334 characters in body
Source Link
ccpizza
  • 111
  • 4

The page at https://developer.mozilla.org/en-US/Firefox/Headless_mode lists the --window-size=x,y which you can add viawith opts.add_argument("--window-size=1900,1080").

Complete example which works with latest firefox v57b8 (assumes you have geckodriver somewhere in your $PATH):

    caps = webdriver.DesiredCapabilities().FIREFOX
    opts = FirefoxOptions()
    opts.add_argument("-headless")
    opts.add_argument("--window-size=1900,1080")
    caps["marionette"] = True
    driver = webdriver.Firefox(capabilities=caps, firefox_options=opts)

The page at https://developer.mozilla.org/en-US/Firefox/Headless_mode lists the --window-size=x,y which you can add via:

opts = FirefoxOptions()
opts.add_argument("--window-size=1900,1080")

The page at https://developer.mozilla.org/en-US/Firefox/Headless_mode lists the --window-size=x,y which you can add with opts.add_argument("--window-size=1900,1080").

Complete example which works with latest firefox v57b8 (assumes you have geckodriver somewhere in your $PATH):

    caps = webdriver.DesiredCapabilities().FIREFOX
    opts = FirefoxOptions()
    opts.add_argument("-headless")
    opts.add_argument("--window-size=1900,1080")
    caps["marionette"] = True
    driver = webdriver.Firefox(capabilities=caps, firefox_options=opts)
Source Link
ccpizza
  • 111
  • 4

The page at https://developer.mozilla.org/en-US/Firefox/Headless_mode lists the --window-size=x,y which you can add via:

opts = FirefoxOptions()
opts.add_argument("--window-size=1900,1080")