from selenium.webdriver.chrome.options import Options options = Options() options.add_extension('/path/to/extension.crx')
from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_extension('/path/to/extension.crx') driver = webdriver.Chrome(options=options)This code will create a new WebDriver with the options object above, which includes the extension. The package library for the selenium.webdriver.chrome.options module is the Selenium WebDriver package, which can be installed using pip install selenium.