我试图使用 python selenium 模块启动任何网站。
首先,我安装了 python selenium-2.31.0 模块,然后我尝试运行以下脚本。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
但它显示以下错误:
Traceback (most recent call last):
File "D:\Backups\Backups\D drive\Softwares\eclipse-galileo\plugins\org.python.pydev.debug_1.4.6.2788\pysrc\pydevd.py", line 881, in <module>
debugger.run(setup['file'], None, None)
File "D:\Backups\Backups\D drive\Softwares\eclipse-galileo\plugins\org.python.pydev.debug_1.4.6.2788\pysrc\pydevd.py", line 710, in run
execfile(file, globals, locals) #execute the script
File "D:\eclipse_workspace\Python_Test\src\TimeSheet_fill.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Python26\lib\site-packages\selenium-2.31.0-py2.6.egg\selenium\webdriver\firefox\webdriver.py", line 59, in __init__
desired_capabilities=capabilities)
File "C:\Python26\lib\site-packages\selenium-2.31.0-py2.6.egg\selenium\webdriver\remote\webdriver.py", line 67, in __init__
self.start_session(desired_capabilities, browser_profile)
File "C:\Python26\lib\site-packages\selenium-2.31.0-py2.6.egg\selenium\webdriver\remote\webdriver.py", line 109, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python26\lib\site-packages\selenium-2.31.0-py2.6.egg\selenium\webdriver\remote\webdriver.py", line 160, in execute
self.error_handler.check_response(response)
File "C:\Python26\lib\site-packages\selenium-2.31.0-py2.6.egg\selenium\webdriver\remote\errorhandler.py", line 127, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message:
Exception AttributeError: "'NoneType' object has no attribute 'print_exc'" in <bound method Popen.__del__ of <subprocess.Popen object at 0x02C6C0F0>> ignored
我的脚本有什么问题,我应该怎么做才能启动网站?