Premise: install Python, pip, chrome
- Command: pip install selenium
- The first installation error, the second successful installation
Installation chromedriver:
- Get the installed chrome version: chrome: // version / (chrome into the address bar)
- Download Mirror: https: //npm.taobao.org/mirrors/chromedriver/
- And try to find similar chromedriver chrome (the last 3 digits may vary)
- Can not find win64 and downloaded 32, it is also possible
- Store address: run the unzipped file into a chrome chromedriver.exe in: C: \ Program Files (x86) \ Google \ Chrome \ Application
Code validation:
from selenium import webdriver driver = webdriver.Chrome( executable_path='C:\Program Files (x86)\Google\Chrome\Application\chromedriver.exe' ) driver.get('http://www.baidu.com')