4
我試圖運行鉻硒驅動程序,並添加一個推廣:無法運行Chrome的硒「未知錯誤:無法處理擴展#1」
manifest_json = """..... """
background_js = """...."""
ext_file = 'my_extention.zip'
with zipfile.ZipFile(ext_file, 'w') as zp:
zp.writestr("manifest.json", manifest_json)
zp.writestr("background.js", background_js)
co = webdriver.ChromeOptions()
co.add_extension(ext_file)
d = webdriver.Chrome(chrome_options=co)
拋出一個錯誤:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot process extension #1
from unknown error: invalid public key length
(Driver info: chromedriver=2.9.248304,platform=Linux 3.19.0-39-generic x86_64)
這個錯誤,當我提出我的* .zip文件Chrome擴展從一臺計算機到另一臺。我結束了你的解決方案; --load擴展,這是好多了反正。 –
爲我工作(Y) –