0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[走り書き]Selenium + Chrome 136以降で標準プロファイルを読み込めない

Last updated at Posted at 2025-05-03

問題

Chrome ver 136以降をSeleniumから操作しようとするとき、
デフォルトのユーザプロファイルを読み込もうとすると(=いつも使っているサイトのログイン状態等を流用したい)、

DevTools remote debugging requires a non-default data directory. Specify this using --user-data-dir.
とエラーが出て、しばらく待った後
[25112:6836:0504/022112.181:ERROR:google_apis\gcm\engine\registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT
とエラーが出て、session not createdとの例外が投げられ、Chromeが起動できない。

筆者の環境は

Win11 + Chrome 136.0.7103.49 (Official Build) (64 ビット) (cohort: Control) 
Selenium 4.32.0

理由

下記にあるとおり、Chrome ver 136以降では--remote-debugging-port及び--remote-debugging-pipeというSeleniumで使っている機能がデフォルトのデータディレクトリでは封印されたらしく、これが原因と踏んでいます。

対策

Chrome ver 135以下を使うのは現実的ではないので、やむを得ずSelenium用の別データディレクトリ、プロファイルを作り、そちらからログインするようにしています。

Chrome ver 136以降で常用しているプロファイルを使ってSeleniumを起動する方法があったらご教示ください…z

取り急ぎ。誰か一人でも役に立てば幸いです。

0
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?