Although it looks not know what's the use, but still practice it.
Exercise scene: the version number of the browser -
Specific code:
# coding=utf-8 import time from selenium import webdriver driver = webdriver.Chrome() driver.maximize_window() driver.implicitly_wait(6) driver.get("http://www.baidu.com/") time.sleep(1) print(driver.capabilities['version']) # 打印浏览器version的值 driver.quit()
Summary: The key is how driver.capailities [ 'version'] This method
Reference article: https://blog.csdn.net/u011541946/article/details/69569475