(1)导包-webdriver、sleep
from selenium import webdriver
from time import sleep
(2)实例化webdriver,打开浏览器
# 谷歌浏览器
driver = webdriver.Chrome()
# 火狐
driver = webdriver.Firefox()
# edge微软
driver = webdriver.Edge()
# ie
driver = webdriver.Ie()
(3)打开被测网址url
url = "被测网址"
(4)定位、操作元素
(5)暂停、退出浏览器
sleep(5)
driver.quit()