from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
binary = FirefoxBinary(r"D:\Program Files\Mozilla Firefox\firefox.exe")
driver = webdriver.Firefox(firefox_binary=binary) 加载浏览器配置:
# 配置文件地址
profile_directory = r'D:\Program Files\Firefox\config'
# 加载配置配置
profile = webdriver.FirefoxProfile(profile_directory)
# 启动浏览器配置
driver = webdriver.Firefox(firefox_profile=profile
)