from selenium import webdriver driver = webdriver.Chrome() driver.maximize_window() driver.get("https://www.baidu.com") # 获取浏览器名称 browserName = driver.capabilities["browserName"] print(browserName) # 获取浏览器版本 browserVersion = driver.capabilities["browserVersion"] print(browserVersion) driver.close()