Yagami Light
Yagami Light

Reputation: 11

How to add chrome extension to selenium without PermissionError: [Errno 13] Permission denied?

I'm getting this error, error about Permision WHY :

.....
PermissionError: [Errno 13] Permission denied: 'my_path\\1.0.5_0'

When running this :

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


executable_path = "chromedriver.exe"
os.environ["webdriver.chrome.driver"] = executable_path
path = r'my_path\hcdnbmbdfhhfjejboimdelpfjielfnde\1.0.5_0'

chrome_options = Options()
chrome_options.add_extension(path)

driver = webdriver.Chrome(executable_path=executable_path, options=chrome_options)
driver.get("http://stackoverflow.com")
driver.quit()

Upvotes: 0

Views: 1362

Answers (1)

Yagami Light
Yagami Light

Reputation: 11

# path have to be to .crx file of extension NOT EXTENSION FOLDER
# you have to convert all extension folder to .crx (you can do it online just google it)

path = r'my_path\Your_Extension.crx'

# This Solved The Problem

Upvotes: 1

Related Questions