Running Selenium WebDriver using Python with extensions (.crx files)

Just add this extra line in your program

from selenium.webdriver.chrome.options import Options it will work…

like this

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chop = webdriver.ChromeOptions()
chop.add_extension('Adblock-Plus_v1.4.1.crx')
driver = webdriver.Chrome(chrome_options = chop)

Leave a Comment