Quickly build a Python selenium environment

1. Python install selenium package: pip install selenium

2. Install the driver for the operating system:

①. View Google Chrome version

②. Go to  https://chromedriver.storage.googleapis.com/index.html to  download the corresponding driver of the browser (need to overturn the wall)

chromedriver.exe

③. Place the downloaded browser driver: under the Scripts directory of the Python installation directory

3. Test, if the following code can run normally, it means that the environment is set up successfully:

if __name__ == '__main__':
    chrome = Chrome()
    chrome.get('https://www.baidu.com')

 

Guess you like

Origin blog.csdn.net/zhu6201976/article/details/103939289
Recommended