0

Am facing the below error while executing the chromedriver in selenium-python.

Error:WebDriverException: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

driver = webdriver.Chrome(executable_path="F:/SSN/SSN/Python/chromedriver")

2 Answers2

0
driver: WebDriver = webdriver.Chrome("/Users/this can change/PycharmProjects/this is the title of the project/drivers/chromedriver")

SO in order to reach the above point: 1) Dowload Chromedriver (I guess you already did it) 2) On your project title (if you use pycharm it is up-left) and click dx to open the menu>New>Directory and give the name of the new directory "Drivers". 3)From Download forlder, or whatever position your chromedriver.exe file has been downloaded in step 1), take it and drag it into the "Download" folder. 4)Click right on the folder "Drivers">click on "Copy Path" 5)Past the "Copy Path" just after driver: WebDriver = webdriver.Chrome("HERE")

If this explanation sounds difficult just click here: https://www.youtube.com/watch?v=eDrFWRi13DY

Alessio
  • 13
  • 1
  • 6
  • (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape, now am getting the above error – charan reddy Dec 21 '19 at 11:47
  • may you please share your coding? So I can see what could be the problem – Alessio Dec 21 '19 at 17:31
  • from selenium import webdriver from bs4 import BeautifulSoup import pandas as pd driver = webdriver.chrome(executable_path='C:\Users\a02450\Desktop\Stock\chromedriver_win3\chromedriver.exe') – charan reddy Dec 22 '19 at 11:20
  • Even i add the r in front of 'c:\ & removed the executable_path= also am getting the same error – charan reddy Dec 22 '19 at 11:21
  • Sorry it is difficult to me to understand if you cannot share your code, because I am not an expert – Alessio Jan 07 '20 at 06:29
0

You can try as following

driver = webdriver.Chrome(executable_path=r'Path_to_chrome_Driver\\chromedriver.exe')

Please download chrome driver for selenium Chrome Driver. Then enter the chrome driver location.

Note: Make sure you have downloaded the correct chromedriver based on your chrome browser version.

Mat
  • 178
  • 7