utilisant Python 2.5 OS Windows Vista Une erreur est survenue quand j'ai essayé d'installer Sélénium 2,13 en utilisantPython et Sélénium - Installation ne fonctionne pas
pip install -U Selenium
C:\Users\User>pip install -U Selenium
Downloading/unpacking Selenium
Downloading selenium-2.13.1.tar.gz (3.3Mb): 3.3Mb downloaded
Running setup.py egg_info for package Selenium
warning: no files found matching 'docs\api\py\index.rst'
c:\Python25\lib\distutils\dist.py:263: UserWarning: Unknown distribution option: 'src_root'
warnings.warn(msg)
Downloading/unpacking rdflib==3.1.0 (from Selenium)
Downloading rdflib-3.1.0.tar.gz (249Kb): 249Kb downloaded
Running setup.py egg_info for package rdflib
Installing collected packages: Selenium, rdflib
Found existing installation: selenium 2.13.1
Uninstalling selenium:
Successfully uninstalled selenium
Running setup.py install for Selenium
warning: no files found matching 'docs\api\py\index.rst'
c:\Python25\lib\distutils\dist.py:263: UserWarning: Unknown distribution option: 'src_root'
warnings.warn(msg)
c:\Python25\Lib\site-packages\selenium\webdriver\remote\webdriver.py:668: Warning: 'with' will become a reserved keyword in Python 2.6
File "c:\Python25\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 668 with open(filename, 'wb') as f:
^
SyntaxError: invalid syntax
Found existing installation: rdflib 3.1.0
Uninstalling rdflib:
Successfully uninstalled rdflib
Running setup.py install for rdflib
Successfully installed Selenium rdflib
Cleaning up...
donc téléchargé le package Sélénium 2,13 manuellement et copié le fichier selenium.py dans c:/python25/lib /. Cependant, lorsque je tente d'importer WebDriver à partir de python il me donne l'erreur suivante:
C:\Users\User>python F:\Selenium\localtest2.py
Traceback (most recent call last):
File "F:\Selenium\localtest2.py", line 1, in <module>
from selenium import webdriver
ImportError: cannot import name webdriver
Y at-il un problème avec le sélénium installer ou est-il quelque chose de mal que je fais? Peut-être que copier le fichier selenium.py est stupide? Newbie, ours avec moi. Suivi le tutoriel donné here.
Dans le tutoriel ci-dessus, je ne comprenais pas comment faire: « Ajouter au chemin de votre test le fichier selenium.py »
Vous l'avez cloué, j'ai passé à 2,7 peu de temps après avoir posté cette question et cela a fonctionné ... merci quand même! – Ashwin
ne devriez-vous pas le mettre en colère alors? –