Open kpbino opened 4 years ago
C:\Users\xin>C:\Users\xin\Desktop\N95-watcher-master\src\watcher.py Traceback (most recent call last): File "C:\Users\xin\Desktop\N95-watcher-master\src\watcher.py", line 55, in browser = webdriver.Chrome(os.path.join(os.path.dirname(file), "chromedriver")) File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init self.service.start() File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, OSError: [WinError 193] %1 不是有效的 Win32 应用程序。
改一下17行chromedriver为chromedriver.exe,默认是Linux的,改成win的就好
楼上正解,windows在报错地方改为chromedriver.exe即可
C:\Users\xin>C:\Users\xin\Desktop\N95-watcher-master\src\watcher.py Traceback (most recent call last): File "C:\Users\xin\Desktop\N95-watcher-master\src\watcher.py", line 55, in
browser = webdriver.Chrome(os.path.join(os.path.dirname(file), "chromedriver"))
File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in init
self.service.start()
File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\xin\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。