1、下载chromedriver.exe 入在chrome 浏览器目录下
from selenium import webdriver
import os
chromedriver = "C:\Users\AppData\Local\Google\Chrome\Application\chromedriver.exe"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)
driver.get("http://baidu.com")
driver.quit()
时间: 2024-10-12 11:53:37