Using Extensions with Selenium (Python)


I am currently using Selenium to run instances of Chrome to test web pages. Each time my script runs, a clean instance of Chrome starts up (clean of extensions, bookmarks, browsing history, etc). I was wondering if it’s possible to run my script with Chrome extensions. I’ve tried searching for a Python example, but nothing came up when I googled this.


You should use Chrome WebDriver options to set a list of extensions to load. Here’s an example:

import os
from selenium import webdriver
from import Options

executable_path = "path_to_webdriver"
os.environ[""] = executable_path

chrome_options = Options()

driver = webdriver.Chrome(executable_path=executable_path, chrome_options=chrome_options)

Hope that helps.

Answered By – alecxe

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published