I am trying to initialize Firefox driver on Python Selenium Webdriver using following code:
driver = webdriver.Firefox('C:\\Users\\Kartik\\geckodriver.exe')
Now this is showing the following error:
Error: NotAValidDirectory:: The directory name is invalid: 'C:\\Users\\Kartik\\geckodriver.exe'
I tried using single forward slashes in the driver path, but that's also causing the following problem:
File "C:\Users\Kartik\eclipse-workspace\pythonDemo\python_demo_package\AmazonLogin.py", line 17
driver = webdriver.Firefox('C:\Users\Kartik\geckodriver.exe')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape