pythonselenium-webdriverweb-scrapingselenium-edgedriver

Edge driver Keeps crashing when loading the specified options


I am trying to create a driver for web scraping using edge, since the new chrome version is not compatible with selenium. However it seems like every time I try to load the specified options, the options are loaded successfully but it always return an error.

from selenium.webdriver.edge.options import Options
from selenium import webdriver
options = Options()
options.add_argument("user-data-dir=C:\\Users\\my_user_name\\AppData\\Local\\Microsoft\\Edge\\User Data")
driver = webdriver.Edge(options=options) #The code crashes here
driver.get('https://web.whatsapp.com/')

I'm getting the error

Microsoft::Applications::Events::ILogConfiguration::operator* [0x00007FF799F7AF66+4918]
Microsoft::Applications::Events::EventProperty::~EventProperty [0x00007FF799F6F431+713057]
BaseThreadInitThunk [0x00007FF8575C7614+20]
RtlUserThreadStart [0x00007FF858E826F1+33]

Solution

  • All I had to do , is to create a copy of my User Data folder, in the same parent folder,

    AppData\\Local\\Microsoft\\Edge, and called it User Data1. I changed my python code to this :

    options.add_argument("user-data-dir=C:\\Users\\my_user_name\\AppData\\Local\\Microsoft\\Edge\\User Data1")
    

    Now it works