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

Time:10-13

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.

CodePudding user response:

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)

  • Related