My computer is Win7 64-bit, installed chrome is also 64-bit, found on the Internet a 64-bit chromedriver, find running code error, the corresponding code in Firefox downgrade Test no problem.
First guess, chromedriver version and Chrome version compatibility problem, looked for a long time, found on-line basic 64-bit chromedriver resources download. Finally, I found a blog post:
Original address: http://blog.csdn.net/huilan_same/article/details/51896672
Chromedriver the relationship with Chrome:
Chromedriver version |
supported versions of Chrome |
v2.24 |
v52-54 |
v2.23 |
v51-53 |
v2.22 |
v49-52 |
v2.21 |
V46-50 |
v2.20 |
v43-48 |
v2.19 |
v43-47 |
v2.18 |
v43-46 |
v2.17 |
v42-43 |
v2.13 |
V42-45 |
v2.15 |
v40-43 |
v2.14 |
V39-42 |
v2.13 |
v38-41 |
v2.12 |
V36-40 |
v2.11 |
V36-40 |
v2.10 |
V33-36 |
v2.9 |
V31-34 |
v2.8 |
V30-33 |
v2.7 |
V30-33 |
v2.6 |
V29-32 |
v2.5 |
V29-32 |
v2.4 |
V29-32 |
Chromedriver: http://chromedriver.storage.googleapis.com/index.html
Finally, I installed the 32-bit chrome and downloaded the corresponding 32-bit driver to run the script successfully.
PS: Place the downloaded driver in the appropriate directory for Chrome: google\chrome\application
You can then configure the PATH environment variable.
Selenium Python calls the chrome environment configuration