繁体   English   中英

(Python/Conda)安装导入Firefox 11兼容selenium版本

[英](Python/Conda) Installing and importing Firefox 11-compatible selenium version

我一直试图让 Selenium 与 Firefox 11 一起工作,但没有运气。 conda (3.141.0) 中可用的当前版本与 Firefox 11 不兼容; 当我尝试创建一个不同的环境并下载 Selenium 2.53.5(我相信它可以与 FF 11 一起使用)时,它不会让我将模块导入到 a.py 文件、python REPL 或 ipython 中。 错误:

康达清单:

#
# Name                    Version                   Build  Channel
certifi                   2018.8.24             py35_1001    conda-forge
pip                       20.1.1                     py_1    conda-forge
python                    3.5.5                he025d50_2    conda-forge
selenium                  2.53.5                   py35_0    conda-forge
setuptools                40.4.3                   py35_0    conda-forge
vc                        14.1                 h869be7e_1    conda-forge
vs2015_runtime            14.16.27012          h30e32a0_2    conda-forge
wheel                     0.34.2                     py_1    conda-forge
wincertstore              0.2                   py35_1002    conda-forge

Python REPL:

Python 3.5.5 | packaged by conda-forge | (default, Jul 24 2018, 01:52:17) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'selenium'

为什么会这样?

不幸的是,我只能使用 Firefox v11(由于某些专有的 Java 公司代码无法在更高版本上运行)。

我应该使用哪个 selenium/conda/python/selenium 版本以及如何安装/导入它们? 谢谢!

你正在穿越到 2012 年,所以这会很困难。 我浏览了发行说明,发现 Selenium 2.21 提到了 Firefox 11,因此可以兼容。

您应该能够在 requirements.txt 文件中指定版本。 如果您无法启动浏览器,您可能想尝试大约相同年龄的 python 版本,也许从 python 2 的最后一个版本开始并向后工作。

https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG#L2237

https://pypi.org/project/selenium/2.22.1/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM