Why is my spyder kernel crashing after opening a chrome browser instance with my default profile on a Python program? Selenium related
You need to take care of a couple of things here:
-
You need to remove
Default
from the profile PATH. So effectively your line of code will be:opt.add_argument("--user-data-dir=r'C:\Users\ResetStoreX\AppData\Local\Google\Chrome\User Data') #PATH profile
You can find a couple of relevant detailed discussions in:
- How to use Chrome Profile in Selenium Webdriver Python 3
- selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed with ChromeDriver and Selenium in Python
- Selenium: Point towards default Chrome session
-
You need to pass the absolute path of the ChromeDriver within
Service()
as follows:s = Service('C:\path\to\chromedriver.exe')