如何在没有权限的情况下向selenium添加chrome扩展错误:[errno 13]权限被拒绝?

krugob8w  于 2021-08-25  发布在  Java
关注(0)|答案(1)|浏览(373)

我得到了这个错误,关于权限的错误为什么:

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

运行此操作时:

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()
tv6aics1

tv6aics11#


# 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

相关问题