-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
I-defectSomething is not working as intendedSomething is not working as intendedI-questionApplied to questions. Issues should be closed and send the user to community resources.Applied to questions. Issues should be closed and send the user to community resources.
Description
What happened?
I am trying to launch a headless Chrome WebDriver using Selenium in Python. However, I keep encountering this error:
How can we reproduce the issue?
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
def createModel():
service = Service(ChromeDriverManager().install())
options = webdriver.ChromeOptions()
# Specifying user data directory
options.add_argument("--user-data-dir=/root/video-downloader/tmp/selenium-user-data")
options.add_argument("--headless=new")
options.add_argument("--start-maximized")
driver = webdriver.Chrome(service=service, options=options)
return driver
driver = createModel()
driver.get("https://www.google.com")
print(driver.title)
driver.quit()
Relevant log output
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: probably user data directory is already in use,
please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
Operating System
Ubuntu
Selenium version
4.29.0
What are the browser(s) and version(s) where you see this issue?
Chrome
What are the browser driver(s) and version(s) where you see this issue?
Google Chrome 133.0.6943.126 ChromeDriver stable(auto)
Are you using Selenium Grid?
No response
Venousek, stanislaw, js-robinson, niceguy4, Raanasukumar and 5 more
Metadata
Metadata
Assignees
Labels
I-defectSomething is not working as intendedSomething is not working as intendedI-questionApplied to questions. Issues should be closed and send the user to community resources.Applied to questions. Issues should be closed and send the user to community resources.