1

I am trying to use selenium for my project when I run my python file which contains the following codes , I get an error written just below the file code.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://google.com')

**

[WDM] - Current google-chrome version is 85.0.4183 [WDM] - Get LATEST driver version for 85.0.4183 [WDM] - Driver [C:\Users\AHG.wdm\drivers\chromedriver\win32\85.0.4183.87\chromedriver.exe] found in cache Traceback (most recent call last): File "newWeb.py", line 9, in driver = webdriver.Chrome(ChromeDriverManager().install()) File "C:\Anaconda3\envs\ppp_web\lib\site-packages\webdriver_manager\chrome.py", line 34, in install os.chmod(driver_path, 0o755) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\ppp\.wdm\drivers\chromedriver\win32\85.0.4183.87\chromedriver.exe'

**

could anyone help me how to solve this issue.

Talib Daryabi
  • 733
  • 1
  • 6
  • 28
  • Duplicate - https://stackoverflow.com/questions/42478591/python-selenium-chrome-webdriver – akiva Oct 04 '20 at 09:48

3 Answers3

0

I had the same problem once. I have to download the ChromeDriver and connect it to an absolute path.

driver = webdriver.Chrome(r "C:\Users\Normal\Desktop\WebCrawler\chromedriver_win32\chromedriver.exe")

You can download the driver from the web. For example: https://chromedriver.chromium.org/downloads

SeRo
  • 85
  • 7
  • I am using it like that. I think your missing the right version of the chrome driver. – SeRo Oct 04 '20 at 17:03
0

I have had the same issue

in my issue, I solved when ı delete drivers.json and drivers file inside of "C:\Users\ppp\.wdm"

installed drivers have inside of drivers.json .but sometimes something can delete driver but not delete inside of drivers.json ChromeDriverManager().install() opens drivers.json file. and that gets the last installed chrome driver path from the driver.json. the driver uses from there if it is the last version. when the driver uses from this path but there is no file. it causes this problem

HatLess
  • 10,622
  • 5
  • 14
  • 32
yunus
  • 33
  • 1
  • 9
0

I'll elaborate on Yunus' Answer (albeit a little late):

Inside "C:\Users\[UserName]\.wdm" folder, there is a file called drivers.json

Drivers.json

Just right click and edit with your IDE (I use Spyder)

Edit with IDE

Then correct the path you want it to be, save the file, and you shouldn't get this error again. If you do everything correctly, you should be able to use your original code. The reason it's better, in my opinion, to update the drivers.json file is in case you use this code on a different computer.

Drivers.json file

S.B
  • 13,077
  • 10
  • 22
  • 49