Pre-installation preparation
Installation and Configuration
Under Window: Find Run in the start menu and type cmd or directly search for cmd and click enter, type python, if the >>> > in the figure below appears, it proves that Python installation is successful.
Detecting the version number of Chrome Installing Chromedriver
Record the version number:87.0.4280.88
Open the ChromeDirver URL:/
Select the folder with the corresponding version number and open it
Environment Configuration for ChromeDriver
ChromeDriver downloads and unpacks as a
Place in any folder (we recommend placing it in a folder with the same name as the browser e.g.)
Configure environment variables (configure them and use the CMD command line to quickly open them):
This PC = "Properties = "Advanced Properties
New variable, paste the path (of the path)
After configuration, test with cmd
Type chromedriver, correct as follows
Installing selenium (python command)
Under Cmd, type: python -m pip install selenium and wait for the installation to complete.
To update pip, type python -m pip install --upgrade pip
After successful installation, type python -m pip install selenium again, and it will appear as complete.
Testing, Python Testing Selenium + ChromeDriver
Create a new python file with the following contents
from selenium import webdriver import time def a(): b=() ('/') (3) () if __name__=='__main__': a()
will automatically open the Chrome browser, and visit the home page of Baidu, Note: In order to Python crawler speed, at this time, Chrome for the pure version, without any plug-ins, such as plug-ins to help crawl, can be completed in code!
Some problems during installation
If any of the above errors occur, check them in order
1, whether the version of ChromeDriver corresponds to the current Chrome version number.
(Chrome kernel updates itself)
environment configuration, cmd input chromedriver no problem can be
3. Close the IDE (the current python compiler) and restart it
To this point this article on Python + Selenium + ChromeDriver configuration and problem solving article is introduced to this, more related Selenium ChromeDriver configuration content please search for my previous articles or continue to browse the following related articles I hope that you will support me in the future more!