Installation of the Selenium library

Determine the version number of Google Chrome

Download the ChromeDriver

Npm.taobao.org/mirrors/chr…

If there is no corresponding version, download the closest one

To install Selenium library

In the command line window, enter PIP Install Selenium

test

code

Executable_path =r Specifies the ChromeDriver directory

from selenium import webdriver
w=webdriver.Chrome(executable_path=r'D:\web\chromedriver.exe')
w.get('https://www.baidu.com/')
Copy the code

Executable_path =r’d :\web\ Chromedriver.exe ‘

from selenium import webdriver
w=webdriver.Chrome()
w.get('https://www.baidu.com/')
Copy the code

Pop-up Google browser into Baidu said that the installation is successful