Cookie百度案例:代码与老师的完全一致,不知为什么报错。 报错日志如下:
D:\python\python.exe C:/Users/liufeilong/Desktop/Cookie/cookie.py Traceback (most recent call last): File "D:\python\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\python\lib\subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "D:\python\lib\subprocess.py", line 997, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/liufeilong/Desktop/Cookie/cookie.py", line 5, in driver = webdriver.Firefox() File "D:\python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 164, in __init__ self.service.start() File "D:\python\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. Process finished with exit code 1