When building a crawling environment with Selenium, I got the following error. It is a Mac environment.
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
It seems that the pass has not passed. Try to specify the location where the chrome driver is saved.
webdriver.Chrome(executable_path='Path with Chrome driver')
It worked on JupyterLab, but it didn't work when I tested it with .py
.
so
Install chromedriver-binary.
pip install chromedriver_binary==chromedriver version
On JupyterLab, prefix it with "!" And like this ↓
!pip install chromedriver_binary==chromedriver version
I will check it.
from selenium import webdriver
import chromedriver_binary
driver = webdriver.Chrome()
So, if Chrome starts up, it's OK for the time being.
The chromedriver will install the one that corresponds to the build of Chrome you are currently using.
For example, if Chrome is 84.0.4147.105
, it looks like Chrome Driver 84.0.4147.30
.
If the major version is different, build
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
I get an error like this and it doesn't work.
Recommended Posts