Error message: "'chromedriver' executable needs to be available in the path"
I see the discussions still talk about the old way of setting up chromedriver by downloading the binary and configuring the path manually.
This can be done automatically using webdriver-manager
pip install webdriver-manager
Now the above code in the question will work simply with below change,
from selenium import webdriverfrom webdriver_manager.chrome import ChromeDriverManagerdriver = webdriver.Chrome(ChromeDriverManager().install())
The same can be used to set Firefox, Edge and ie binaries.
You can test if it actually is in the PATH, if you open a cmd and type in
chromedriver (assuming your chromedriver executable is still named like this) and hit Enter. If
Starting ChromeDriver 2.15.322448 is appearing, the PATH is set appropriately and there is something else going wrong.
Alternatively you can use a direct path to the chromedriver like this:
driver = webdriver.Chrome('/path/to/chromedriver')
So in your specific case:
driver = webdriver.Chrome("C:/Users/michael/Downloads/chromedriver_win32/chromedriver.exe")