Unable to use user data directory msedge

I have a problem here I'm trying to run edge (from msedge-selenium-tools) and it doesn't open the default profile here's the code:

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")

it doesn't load the profile and yes is there an any way to get rid of edge being pinned to taskbar? Thanks in advance!

EDIT: I didn't notice the traceback whole time:

[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)

1 answer

  • answered 2021-07-28 08:14 JokeGamer

    OK I solved my problem

    Thank you all

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum