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

vip*_*169 14 ide libraries

我想检查我正在使用的 Selenium API 版本。我试着用谷歌搜索它,但找不到。

Joe*_*770 14

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

>>> 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
Run Code Online (Sandbox Code Playgroud)


小智 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
Run Code Online (Sandbox Code Playgroud)

  • 或者作为单个命令:`python -c 'import selenium; 打印 selenium.__version__'` (3认同)

vip*_*169 4

您可能会在 IDE(Eclipse 或您正在使用的任何东西)中引用 jar。检查构建路径库。请参阅下面的屏幕截图:-

在此输入图像描述