如何检查已安装的Selenium API的版本?


12

我想检查我正在使用的Selenium API的版本。我尝试使用Google进行搜索,但找不到。


您能告诉我们什么时候安装的吗?
rɑːdʒɑ

可能是2-3个月前。不确定
vipin8169

也许这可以为您提供帮助,说实话我也没有找到,但这是我所提供的docs.seleniumhq.org/download
rɑːdʒɑ

终于找到了它
vipin8169

1
我很高兴收到您的通知,并感谢您提出正确的解决方法。我相信此答案将对将来需要此功能的用户有所帮助。
rɑːdʒɑ

Answers:


12

这是我在Python中检查硒版本的方法。

>>> import selenium    
>>> help (selenium)
Help on package selenium:

NAME
    selenium

FILE
    c:\python27\lib\site-packages\selenium\__init__.py

DESCRIPTION
    # Licensed to the Software Freedom Conservancy (SFC) under one
    # or more contributor license agreements.  See the NOTICE file
    # distributed with this work for additional information
    # regarding copyright ownership.  The SFC licenses this file
    # to you under the Apache License, Version 2.0 (the
    # "License"); you may not use this file except in compliance
    # with the License.  You may obtain a copy of the License at
    #
    #   http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing,
    # software distributed under the License is distributed on an
    # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    # KIND, either express or implied.  See the License for the
    # specific language governing permissions and limitations
    # under the License.

PACKAGE CONTENTS
    common (package)
    selenium
    webdriver (package)

DATA
    __version__ = '2.48.0'

VERSION
    2.48.0

6

您也可以locate selenium在终端中运行,并且可以在文件名中看到版本号。


5
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
>>> print selenium.__version__
3.3.0

3
或作为一个命令:python -c 'import selenium; print selenium.__version__'
David Foerster

您需要更多文字来回答。
菲尔英国

print( selenium.__version__ )对于Python3 ...是的,它非常非常非常非常非常非常非常非常非常非常非常明显。但可能会帮助某人!
麦克啮齿动物

4

您可能已经在IDE(Eclipse或任何您正在使用的东西)中引用了jar。检查构建路径库。请参阅下面的ScreenShot:

在此处输入图片说明


1

确定Selenium版本的另一种方法是通过命令行:

dpkg-query --list '*selenium*'

输出:

所需=未知/安装/删除/清除/保持
| 状态=不/安装/配置文件/未打包/ halF-conf /半安装/ trig-aWait /触发挂起
| / Err?==(无)/需要重新输入(状态,Err:大写=错误)
|| /名称版本体系结构描述
+++-============================================== =====-============================================ ================-================================ ================================================== ========================
ii python-selenium 2.48.0 + dfsg1-2 Selenium的所有Python绑定

0

仅出于完整性考虑-如果您已通过pip安装了硒,则可以执行以下操作:

pip freeze

并查看已安装的版本(如果有)。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.