您应该使用Chrome WebDriver 选项设置要加载的扩展程序列表。这是一个例子:
import osfrom selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsexecutable_path = "path_to_webdriver"os.environ["webdriver.chrome.driver"] = executable_pathchrome_options = Options()chrome_options.add_extension('path_to_extension')driver = webdriver.Chrome(executable_path=executable_path, chrome_options=chrome_options)driver.get("http://stackoverflow.com")driver.quit()希望能有所帮助。



