栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

WebDriverException:消息:通过Python 3.7使用GeckoDriver Firefoxv65和Selenium的newSession

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

WebDriverException:消息:通过Python 3.7使用GeckoDriver Firefoxv65和Selenium的newSession

不知道哪里出了问题,但似乎有多个二进制版本的混淆。但是我正在使用以下配置:

  • 的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

兼容性表中的配置矩阵
__



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/624951.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号