'chromedriver' executable needs to be in PATH solution

Python calls Google Chrome to report an error

 Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Solution

The reference articles are as follows:

['chromedriver' executable needs to be in PATH solution]
(https://www.jianshu.com/p/dc0336a0bf50)

The operation steps are as follows
Step 1. Download chromedriver
The download address of chromedriver:
http://chromedriver.storage.googleapis.com/index.html

Note here: there are many versions of chromedriver, be sure to download the version corresponding to the version of the chrome browser on your computer. For the corresponding relationship, please refer to the article http://blog.csdn.net/huilan_same/article/details/51896672. The author of this article is a relatively new version.

Tips: Enter chrome://version/ in the Chrome browser address bar and press Enter, and the browser version and installation directory will be displayed on the page.
Step 2. Copy chromedriver.exe to the Chrome browser installation directory
. After downloading the zip package, unzip it. It is found that there is only one chromedriver.exe file in it. This file does not need to be installed on the computer through the wizard mode, but only needs to be placed under the Chrome browser installation directory. As shown in the figure below, my Chrome browser is installed in the C:\Program Files (x86)\Google\Chrome\Application directory, just copy the decompressed chromedriver.exe driver file to this directory.

Find the Chrome browser installation directory.png
Step 3. Add the browser environment variable to the path
Open the Start Menu -> My Computer (or Computer) -> System Properties -> Advanced System Settings -> Environment Variables, edit the user variables in path,
add at the end; C:\Program Files (x86)\Google\Chrome\Application
or add C:\Program Files (x86)\Google\Chrome\Application at the beginning;
in short, separate variables with semicolons After modification, click the OK button to save the configuration.

Step 4. Re-run the Python program.
If this step still fails, you need to place the chromedriver.exe in the Python running file XX.ipynb directory C:\Users\lenovo\mycode

Guess you like

Origin blog.csdn.net/quantam/article/details/109329368