selenium: [πŸ› Bug]: Error using user-data-dir= in Chrome 103.0.5060.53

What happened?

When using chrome_options.add_argument(β€˜user-data-dir=’ in Chrome 103 the error occurs:

Selenium.common.exceptions.WebDriverException: Message: unknown error: unexpected command response (Session info: chrome=103.0.5060.53)

if I remove this parameter, it works.

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('user-data-dir=C:\\Perfil')

driver_path = 'chromedriver.exe'
service = Service(driver_path)
driver = webdriver.Chrome(service=service,options=chrome_options)

driver.get("https://google.com")

Relevant log output

elenium.common.exceptions.WebDriverException: Message: unknown error: unexpected command response
  (Session info: chrome=103.0.5060.53)
Stacktrace:
Backtrace:
	Ordinal0 [0x007E6463+2188387]
	Ordinal0 [0x0077E461+1762401]
	Ordinal0 [0x00693D78+802168]
	Ordinal0 [0x00687210+750096]
	Ordinal0 [0x0068675A+747354]
	Ordinal0 [0x00685D3F+744767]
	Ordinal0 [0x0068557C+742780]
	Ordinal0 [0x00699BF3+826355]
	Ordinal0 [0x006ECF6D+1167213]
	Ordinal0 [0x006DC5F6+1099254]
	Ordinal0 [0x006B6BE0+945120]
	Ordinal0 [0x006B7AD6+948950]
	GetHandleVerifier [0x00A871F2+2712546]
	GetHandleVerifier [0x00A7886D+2652765]
	GetHandleVerifier [0x0087002A+520730]
	GetHandleVerifier [0x0086EE06+516086]
	Ordinal0 [0x0078468B+1787531]
	Ordinal0 [0x00788E88+1805960]
	Ordinal0 [0x00788F75+1806197]
	Ordinal0 [0x00791DF1+1842673]
	BaseThreadInitThunk [0x75F7FA29+25]
	RtlGetAppContainerNamedObjectPath [0x77987A9E+286]
	RtlGetAppContainerNamedObjectPath [0x77987A6E+238]

Operating System

Windows 10 and Manjaro

Selenium version

Python (Selenium 4)

What are the browser(s) and version(s) where you see this issue?

Chrome 103

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 103.0.5060.53

Are you using Selenium Grid?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 12
  • Comments: 32 (4 by maintainers)

Commits related to this issue

Most upvoted comments

image + Having a same problem now

Folks, posting β€œI have the same issue” does not help much, we cannot do anything because this is a Chrome issue. Please add yourself as a watcher to https://bugs.chromium.org/p/chromedriver/issues/detail?id=4121

Only on 103. On 102 it works.

Is this happening only with Chrome 103? Did it happen with Chrome 102?

Not faced this issue in Chrome 102 version. I’m seeing this issue after updating to chrome 103.

Just add a little pause hold before the place when the driver initiates an URL, as I got success in java using this technique:

//Java code
Thread.sleep(5000);
driver.get("https://www.google.com");

I have encountered exactly same issue. I then upgrade the Chromedriver to 104 and Chrome Browser to 104 beta. All are working fine now.

Updated at 17:38 on 30.6.2022: Seem even Chrome 104 still has problem. Finally, I have switched to Microsoft Edge and then my script is working well now…

Just add a little pause hold before the place when the driver initiates an URL, as I got success in java using this technique:

//Java code
Thread.sleep(5000);
driver.get("https://www.google.com");

This solution is good. working without remove β€œuser-data-dir=” in C#

Thanks for sharing! I am using Python. Seem the behaviour is so strange, I have the same script to scrape data from two different sites. One is working fine with Chrome 103 but another had some problems. I observed that Chrome 103 cannot read user cookie data in the dir so some setting lost and cannot scrape accurate data.

Just add a little pause hold before the place when the driver initiates an URL, as I got success in java using this technique:

//Java code
Thread.sleep(5000);
driver.get("https://www.google.com");

This solution is good. working without remove β€œuser-data-dir=” in C#

Is this happening only with Chrome 103? Did it happen with Chrome 102?