The above solution is technically justified, seems to be complicated, so I thought of a different way of doing this. Because many times I need a lot of things that are better to do manually, authentications, certain cookies, etc.
I use folders as profiles, I run:
chrome_options = Options() chrome_options.add_argument("user-data-dir=selenium") driver = webdriver.Chrome(chrome_options=chrome_options) driver.get("www.google.com")
Then I manually install the extensions and execute the logins that I need now, every time I start Webdriver with this folder, everything is there
chrome_options = Options() chrome_options.add_argument("user-data-dir=selenium") driver = webdriver.Chrome(chrome_options=chrome_options) driver.get("www.google.com")
The advantage is that you can use several folders with different settings and extensions without having to install and remove extensions, change settings, change logins, etc.
source share