菜鸟求帮助selenium+Python运行报错
# coding=utf-8
from selenium import webdriver
driver=webdriver.Firefox()
driver.get("http://www.baidu.com")
driver.find_element_by_id("kw").sendkeys("Selenium2")
driver.find_element_by_id("su").click()
运行报以下错误,找不到指定文件?求解应如何处理
C:\Python34\python.exe "C:/Documents and Settings/Administrator/PycharmProjects/study/baidu.py"
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
stdout=self.log_file, stderr=self.log_file)
File "C:\Python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1114, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Documents and Settings/Administrator/PycharmProjects/study/baidu.py", line 4, in <module>
driver=webdriver.Firefox()
File "C:\Python34\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 140, in __init__
self.service.start()
File "C:\Python34\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x00BEF850>>
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\selenium\webdriver\common\service.py", line 173, in __del__
self.stop()
File "C:\Python34\lib\site-packages\selenium\webdriver\common\service.py", line 145, in stop
if self.process is None:
AttributeError: 'Service' object has no attribute 'process'