|  | 
 
 发表于 2020-4-22 23:42:05
|
显示全部楼层 
| 两个文件都要改什么名字,为什么我有这个错误======= Traceback (most recent call last):
 File "D:\Python\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
 self.process = subprocess.Popen(cmd, env=self.env,
 File "D:\Python\lib\subprocess.py", line 854, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "D:\Python\lib\subprocess.py", line 1307, in _execute_child
 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
 FileNotFoundError: [WinError 2] 系统找不到指定的文件。
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
 File "C:\Users\帅勇\Desktop\爬取彼岸网.py", line 36, in writeCookie
 chrome = webdriver.Chrome(options=chrome_options)
 File "D:\Python\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
 self.service.start()
 File "D:\Python\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
 raise WebDriverException(
 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
 
 
 During handling of the above exception, another exception occurred:
 
 Traceback (most recent call last):
 File "C:\Users\帅勇\Desktop\爬取彼岸网.py", line 195, in <module>
 spider = Spider() # 如果没有cookie
 File "C:\Users\帅勇\Desktop\爬取彼岸网.py", line 18, in __init__
 self.writeCookie()
 File "C:\Users\帅勇\Desktop\爬取彼岸网.py", line 54, in writeCookie
 chrome.quit()
 UnboundLocalError: local variable 'chrome' referenced before assignment
 | 
 |