2013-08-03 522 views
2

我對硒很新,我正在使用它的python軟件包。所以,當我複製並運行它的文檔頁面上找到的代碼:http://selenium.googlecode.com/svn/trunk/docs/api/py/index.html,我得到了以下錯誤:硒導致窗口錯誤

from selenium import webdriver 
from selenium.common.exceptions import NoSuchElementException 
from selenium.webdriver.common.keys import Keys 
browser = webdriver.Firefox() 

Traceback (most recent call last): 
File "<pyshell#3>", line 1, in <module> 
browser = webdriver.Firefox() 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 61, in __init__ 
self.binary, timeout), 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__ 
self.binary.launch_browser(self.profile) 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 50, in launch_browser 
self._start_from_profile_path(self.profile.path) 
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 73, in _start_from_profile_path 
env=self._firefox_env).communicate() 
File "C:\Python27\lib\subprocess.py", line 679, in __init__ 
errread, errwrite) 
File "C:\Python27\lib\subprocess.py", line 893, in _execute_child 
startupinfo) 
WindowsError: [Error 87] The parameter is incorrect 

我跟着這個其他文件:http://selenium-python.readthedocs.org/en/latest/installation.html#downloading-python-bindings-for-selenium安裝硒。

當我運行virtualenv.py文件時,輸出會顯示setuptools * .tar.gz,pip。*。tar.gz未找到,因此我下載了這兩個tar文件並將它們放在seltests文件夾中,然後終端不再抱怨了。所以安裝應該是成功的。任何幫助表示讚賞!我正在使用Windows 7,64位。

回答