不知道哪里出了问题,但似乎有多个二进制版本的混淆。但是我正在使用以下配置:
的Python:3.6.1
C:Usersuser_name>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.硒:3.141.0
C:Usersuser_name>pip show -V selenium
Name: selenium
Version: 3.141.0
Summary: Python bindings for Selenium
Home-page: https://github.com/SeleniumHQ/selenium/
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache 2.0
Location: c:pythonlibsite-packages
Requires: urllib3
Required-by:壁虎驱动程序:0.24.0
C:UtilityBrowserDrivers>geckodriver.exe -V
geckodriver 0.24.0 ( 2019-01-28)
The source pre of this program is available from
testing/geckodriver in https://hg.mozilla.org/mozilla-central.This program is subject to the terms of the Mozilla Public License 2.0.
You can obtain a copy of the license at https://mozilla.org/MPL/2.0/.Firefox:Mozilla Firefox 65.0
C:Program FilesMozilla Firefox>firefox -v |more
Mozilla Firefox 65.0
我已经采用了自己的代码并执行了添加 参数 的代码, executable_path
如下所示:
代码块:
from selenium import webdriver
with webdriver.Firefox(executable_path=r’C:UtilityBrowserDriversgeckodriver.exe’) as driver:
driver.get("http://google.com”)
print(“Page Title is : %s” %driver.title)
driver.quit()控制台输出:
Page Title is : Google
作为一条经验法则,始终遵循[ GeckoDriver](https://firefox-source-
docs.mozilla.org/testing/geckodriver/geckodriver/Support.html)
,
Selenium
和 Firefox
Browser
兼容性表中的配置矩阵
__



