Search code examples
pythonseleniumselenium-webdriverfirefoxgeckodriver

Get browser version using selenium webdriver


How would I get the browser version being used?

>>> from selenium import webdriver
>>> driver = webdriver.Firefox()
>>> print version <-- how to do this?
    Firefox 12.0

Solution

  • The capabilities property is a dictionary containing information about the browser itself, so this should work:

    print(driver.capabilities['version'])