Seleniumを起動するとFailed to read descriptor from node connection: システムに接続されたデバイスが機能していません。と表示された。
Failed to read descriptor from node connectionとは
この文章を直訳すると
ノード接続から記述子を読み取れませんでした
となるのですが、何やら意味が分かりません。
エラー全文を読んでい見てもC:\Users\utarou>[13780:13784:0804/102810.748:ERROR:device_event_log_impl.cc(214)] [10:28:10.749] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: システムに接続されたデバイスが機能していません。 (0x1F)
[13780:13784:0804/102810.758:ERROR:device_event_log_impl.cc(214)] [10:28:10.758] Bluetooth: bluetooth_adapter_winrt.cc:1073 Getting Default Adapter failed.
ふむふむ、何かの接続に失敗しているようだ。上記エラーについて調べてみても人によって意見が違う。。。
しかし、皆が共通して言っている事は「気にしなくて問題なし!!」
結論
Failed to read descriptor from node connection: システムに接続されたデバイスが機能していません。と表示されても、気にしなくて問題はありません。クロームのバージョン87以降にこの表示が出るようになってしまいました。
システムに接続されたデバイスが機能していません。を表示させたくない
とはいえ、このまま放置したらログが溜まりすぎてしまいます。
だったら正常に動作できているのなら「Failed to read descriptor from node connection」を表示させなくしてしまいましょう。
from selenium import webdriver
import chromedriver_binary
d = webdriver.Chrome()
d.get('https://www.google.com/')
上記のコードのままだと「Failed to read descriptor from node connection」と表示されてしまいます。
そこでオプションを定義してエラーを発生させなくします。
from selenium import webdriver
import chromedriver_binary
# オプション定義
options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging'])
options.use_chromium = True
d = webdriver.Chrome(options=options)
d.get('https://www.google.com/')
これでエラーが表示されなくなりました。