Python3 + selenium + Chrome browser (webdriver.Chrome () error)


Python3 + selenium + Chrome browser

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

This is because the call webdriver.Chrome () to set the parameters executable_path, and executable_path is located chromedriver.exe address.

Download chromedriver.exe is http://chromedriver.storage.googleapis.com/index.html

We first need to determine the version of the Chrome browser of the machine, enter the Chrome browser "chrome: // version" can be, as shown below, followed by a colon is the corresponding version of Google Chrome. Chrome version of this machine is 75.0.3770.142, download address is not fully consistent version, download the last version 75.0.3770.142 corresponding also compatible with this machine.

This is the Download interface:

Then we go to the corresponding version of the interface, select the corresponding system of zip and unzip files to download.

After obtaining chromedriver.exe file to webdriver.Chrome () add the parameter executable_path = 'path / chromedriver.exe' (path to the directory where the chromedriver.exe)

After my code run success

 

Guess you like

Origin www.cnblogs.com/EthanHe97/p/11270528.html