Python+Selenium练习之获取浏览器的版本号
程序员文章站
2022-03-13 10:57:28
#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'])
上一篇: 回顾ajax