使用的Python 2.5 操作系統Windows Vista中 有一個錯誤,當我試圖使用Python和硒 - 安裝不工作
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...
人工手動下載的硒2.13包安裝硒2.13和將selenium.py文件複製到c:/ python25/lib /中。然而,當我嘗試蟒之內從進口的webdriver它給了我下面的錯誤:
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
是否存在與硒的一個問題安裝或有什麼不對勁,我在做什麼?也許只複製selenium.py文件是愚蠢的?新手,忍受我。遵循給出的教程here。
在上面的教程我不知道如何做到這一點:「添加到您的測試的路徑的文件selenium.py」
你釘了它,我發佈這個問題後不久,我升級到2.7,它的工作......謝謝! – Ashwin
那你不應該高興他嗎? –