WQSaw
WQSaw

Reputation: 11

filenotfound error - chromedriver (web scraping)

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?

Upvotes: 1

Views: 283

Answers (2)

Pygirl
Pygirl

Reputation: 13339

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())

Upvotes: 1

ImCrimson
ImCrimson

Reputation: 146

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')

Upvotes: 0

Related Questions