Get browser version using selenium webdriver

前端 未结 8 1417
醉话见心
醉话见心 2020-12-06 09:06

How would I get the browser version being used?

>>> from selenium import webdriver
>>> driver = webdriver.Firefox()
>>> print vers         


        
8条回答
  •  無奈伤痛
    2020-12-06 09:30

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

    print(driver.capabilities['version'])
    

提交回复
热议问题