Traceback (most recent call last): File "D:\Python\PLAY.PY", line 29, in <module>

Issue

Need Help in this code

Traceback (most recent call last):
  File "D:\Python\PLAY.PY", line 29, in <module>
    driver = webdriver.Chrome('D:\Python\chromedriver.exe', desired_capabilities=capa, options=options)  # Arguments
  File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Virus\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Failed to create Chrome process.

Solution

You NEED to get in the habit of escaping backslashes. Use one of these options:

driver = webdriver.Chrome('D:\\Python\\chromedriver.exe',desired_capabilities=capa, options=options)
driver = webdriver.Chrome(r'D:\Python\chromedriver.exe',desired_capabilities=capa, options=options)
driver = webdriver.Chrome('D:/Python/chromedriver.exe',desired_capabilities=capa, options=options)

Answered By – Tim Roberts

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published