Skip to content

KeyboardInterrupt when initializing Chrome WebDriver with ChromeOptions profile and user-data-dir #15893

@phamphuochao

Description

@phamphuochao

Description

I am experiencing a KeyboardInterrupt error when trying to initialize Chrome WebDriver using Selenium with options such as --profile-directory and --user-data-dir. The driver initialization hangs and is interrupted either by pressing Ctrl+C or by a timeout. This issue prevents me from automating tasks that require using existing Chrome profiles.

Reproducible Code

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

service = Service("C:/WebDriver/chromedriver-win64/chromedriver.exe")
options = webdriver.ChromeOptions()
options.add_argument("--profile-directory=Profile 4")
options.add_argument("--user-data-dir=C:/Users/HaoPham/AppData/Local/Google/Chrome/User Data")
driver = webdriver.Chrome(service=service, options=options)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-pyPython BindingsD-chromeI-defectSomething is not working as intendedOS-windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions