from selenium import webdriver
from selenium.webdriver.chrome.service import Service
# chromedriver路径设置
service = Service(executable_path='/usr/local/bin/chromedriver')
options = webdriver.ChromeOptions()
# 启动的浏览器路径设置(Mac M1)要具体到软件包内的可执行文件
options.binary_location = '/Applications/Google Chrome for Testing.app/Contents/MacOS/Google Chrome for Testing'
driver = webdriver.Chrome(service=service, options=options)
这样就可以启动自己设置的路径下的webdriver了