1.安装模块
pip install selenium
2.下载驱动,谷歌驱动下载
https://googlechromelabs.github.io/chrome-for-testing/
3.基础参数
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
#浏览器驱动位置
service = Service("../driver/chromedriver.exe")
opt = Options()
opt.add_argument('--disable-blink-features=AutomationControlled')
#关闭自动关闭浏览器
opt.add_experimental_option('detach',True)
driver = webdriver.Chrome(service=service,options=opt)
#浏览器全屏
driver.maximize_window()
driver.get("https://www.bilibili.com/")