Chrome supports only CRX3 format. Does the extension need to be updated? 谷歌瀏覽器更新,selenium添加不了crx插件

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot process extension #1
from unknown error: CRX verification failed to parse extension header. Chrome supports only CRX3 format. Does the extension need to be updated?

chrome一不小心更新到了v80,然後我的自動化測試程序加不了crx插件,是因爲新版本的chrome只支持crx,谷歌了很多,發現一個最簡單的方法,就是自己打包擴展程序,然後得到的就是crx3格式的了,話不多說,直接上圖

C:\Users\你的用戶名\AppData\Local\Google\Chrome\User Data\Default\Extensions

 然後找到需要打包的ID

C:\Users\你的用戶名\AppData\Local\Google\Chrome\User Data\Default\Extensions\neebplgakaahbhdphmkckjjcegoiijjo\3.43_0

將這個路徑複製到擴展程序根目錄,就可以看到打包後的crx文件了

 

chrome_opt.add_extension('3.43_0.crx')

selenium不報錯了,完美

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章