【发布时间】:2021-06-14 16:20:52
【问题描述】:
我试图简单地打开和关闭一个网站并使用 Python3 和 Selenium 获取它的标题。
我的代码-
from selenium import webdriver
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://www.techwithtim.net")
print(driver.title)
driver.close()
它运行成功,但确实在终端中显示这些错误/警告
DevTools listening on ws://127.0.0.1:3040/devtools/browser/7d22edc8-0e93-4498-a836-55e560ffc60b
[65744:16912:0614/221655.716:ERROR:device_event_log_impl.cc(214)] [22:16:55.716] Bluetooth: bluetooth_adapter_winrt.cc:1072 Getting Default Adapter failed.
[65744:16912:0614/221655.772:ERROR:device_event_log_impl.cc(214)] [22:16:55.773] USB: usb_device_handle_win.cc:1058 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
有人可以帮忙吗? 注意 - 我已经安装了 python selenium 模块和 chromewebdriver
【问题讨论】:
-
如果它“运行成功”我很困惑你想要完成什么?只是让错误消失?根据代码,确实是一个很奇怪的错误信息。
-
我知道但仍然询问是否有任何解决方案,因为我在其他情况下看到它不会引发此错误
-
您可能需要检查您正在运行的版本。 stackoverflow.com/a/63270005
-
我使用的是 Google Chrome-Version 91.0.4472.106 (Official Build) (64-bit) 和 Chrome Webdriver - 91.0.4472.19 注意我使用的是 windows