Python+Selenium练习之获取浏览器的版本号
程序员文章站
2022-06-26 11:18:24
#coding=utf-8
from selenium import webdriver
import time
browser = webdriver.Firefox()...
#coding=utf-8
from selenium import webdriver
import time
browser = webdriver.Firefox()
url= 'https://www.baidu.com'
#通过get方法获取当前URL打印
print( "now access %s"%(url))
browser.get(url)
time.sleep(2)
browser.find_element_by_id("kw").send_keys("selenium")
browser.find_element_by_id("su").click()
time.sleep(3)
print(browser.capabilities['browserVersion'])
下一篇: C++中 set的用法