前提
Pythonのseleniumを使用して、chrome操作を行う処理を作成しています。
既存のプロフィールを読み込んで、chromeを起動していますが起動したchromeで
一部のchrome拡張機能が削除されています。
実現したいこと
- Pythonのseleniumを使用し、全てのchrome拡張機能を保持したままchromeを起動/操作したい
該当のソースコード
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service chrome_options = Options() chrome_options.add_experimental_option("detach", True) chrome_options.add_argument('--start-maximized') chrome_options.add_argument(r'--user-data-dir=C:\Users\<ユーザ名>\AppData\Local\Google\Chrome\User Data') # 「bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.」のメッセージ抑止 chrome_options.add_experimental_option('excludeSwitches', ['enable-logging']) service = Service(executable_path='D:\7.Python\5.driver\chromedriver.exe') driver = webdriver.Chrome(service=service,options=chrome_options)
試したこと
chrome拡張機能が保存されている下記フォルダを確認しながら、該当のソースコードを実行すると
chromeが起動するタイミングで該当のchrome拡張機能のフォルダが削除されました。
C:\Users<ユーザ名>\AppData\Local\Google\Chrome\User Data\Default\Extensions
なお、Pythonから起動したchromeを閉じた後、再度手動で開きなおしたら削除されていたchrome拡張機能が
無効化状態で復活します。
※何度やっても同じ動作になります。
補足情報
削除されているchrome拡張機能
- Adobe Acrobat
- Trend ツールバー
- UiPath Web Automation
※上記3つの共通点といえば、他の拡張機能に比べて導入時期が早かったことくらいです。
※他のchrome拡張機能は削除されていません。(15個程度)

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/12/21 14:31
2022/12/22 11:48
2022/12/22 14:35
2022/12/22 14:44
2022/12/22 15:22 編集
2022/12/24 13:13
2022/12/25 02:40 編集
2022/12/29 07:18
2022/12/29 12:02
2022/12/29 18:18 編集
2022/12/30 09:29
2023/01/07 04:21