E:\python\python.exe E:/Users/lenovo/PycharmProjects/pythonProject7/网络爬虫/3.py
Traceback (most recent call last):
File "E:\Users\lenovo\PycharmProjects\pythonProject7\网络爬虫\3.py", line 4, in
driver=webdriver.Firefox(executable_path=r'E:\python\Scripts\geckodriver')
File "E:\python\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 76, in init
command_executor=ExtensionConnection("127.0.0.1", self.profile,
File "E:\python\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 49, in init
self.binary.launch_browser(self.profile)
File "E:\python\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 67, in launch_browser
self._start_from_profile_path(self.profile.path)
File "E:\python\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 88, in _start_from_profile_path
self.process = Popen(
File "E:\python\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "E:\python\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 系统找不到指定的文件。
报错信息说是找不到指定文件,你的驱动文件driver=webdriver.Firefox(executable_path=r'E:\python\Scripts\geckodriver')没写扩展名
应该是
driver=webdriver.Firefox(executable_path=r'E:\python\Scripts\geckodriver.exe')
如有帮助,请点击 采纳 。