Selenium 4.25.0指定浏览器和webdriver的路径
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
def setup_custom_browser(path_to_browser, path_to_webdriver):
chrome_service = Service(executable_path=path_to_webdriver)
chrome_options = Options()
chrome_options.binary_location = path_to_browser
driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
return driver