简体   繁体   中英

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

I've been trying to make Selenium work with Firefox 11 with no luck. The current version available in conda (3.141.0) is not compatible with Firefox 11; and when I tried to create a different environment and download Selenium 2.53.5 (which, I believe, would work with FF 11), it wouldn't let me import the module to either a.py file, python REPL or ipython. Error:

conda list:

#
# 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'

Why would that happen?

Unfortunately, I can only use Firefox v11 (due to some proprietary Java company code that won't run on higher versions).

Which selenium/conda/python/selenium version should I use and how can I install/import them? Thanks!

You are travelling back in time to 2012, so this will be difficult. I skimmed the release notes, and found Selenium 2.21 mentions Firefox 11, so that would be compatible.

You should be able to specify the version in your requirements.txt file. If you can't start the browser, you might want to try a python release that is about the same age, perhaps start with the last release of python 2 and work backwards.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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