无法使用用户数据目录 msedge

Unable to use user data directory msedge

我在尝试 运行 edge(来自 msedge-selenium-tools)时遇到问题,但它没有打开默认配置文件,这里是代码:

from msedge.selenium_tools import Edge
from msedge.selenium_tools import EdgeOptions
edgeoptions = EdgeOptions()
edgeoptions.add_argument(R"user-data-dir=C:\Users\User\AppData\Local\Microsoft\Edge\User Data")
driver = Edge("msedgedriver.exe",options=edgeoptions)
driver.get("https://google.com")

它不加载配置文件,是的,有什么方法可以摆脱固定到任务栏的边缘吗? 提前致谢!

编辑:我一直没有注意到回溯:

[3972:7544:0727/224625.954:ERROR:device_event_log_impl.cc(214)] [22:46:25.954] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[3972:7544:0727/224625.961:ERROR:profile_manager.cc(1058)] Cannot create profile at path C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Default
[3972:7544:0727/224625.961:ERROR:profile_manager.cc(2038)] Cannot create profile at path C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Default
[3972:7544:0727/224626.122:ERROR:secondary_tile_client.cc(219)] OnSecondaryTileManagerDisconnected. Sending error response to callbacks
[3972:7544:0727/224633.600:ERROR:CONSOLE(1355)] "Uncaught (in promise) undefined", source: https://assets.msn.com/bundles/v1/edgeChromium/latest/common.2c045991234e451853e9.js (1355)

好的我解决了我的问题

谢谢大家 编辑: 我用了

edgeoptions.use_chromium = True