1

I intend to do web scraping with selenium.

First, I've downloaded chromedriver and place it in right path/folder. Then, wrote the code as below:

driver = webdriver.Chrome(executable_path=r'C:\Users\chromedriver.exe')

Why is it still showing the error despite I've checked my path is correct countless times?

Mark Rotteveel
  • 82,132
  • 136
  • 114
  • 158
WQSaw
  • 11
  • 2

2 Answers2

1

Which operating system are you using?

Try without mentioning the extension .exe

driver = webdriver.Chrome(executable_path=r'C:\Users\chromedriver')

One Alternative solution without linking executable path is using webdriver-manager. Install it by pip install webdriver-manager

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())
Pygirl
  • 10,115
  • 3
  • 20
  • 33
0

Try calling the file without the .exe I use it regularly and none of my scripts have the file extension.

driver = webdriver.Chrome('C:\Users\chromedriver')
ImCrimson
  • 147
  • 1
  • 1
  • 10