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?
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())
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')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.