gxcuizy / Python

Python3编写的各种大小程序,包含从零学Python系列、12306抢票、省市区地址库以及系列网站爬虫等学习源码
4k stars 1.33k forks source link

python3.8抢票失败 #6

Closed jinliyuelong closed 1 year ago

jinliyuelong commented 3 years ago

File "/Library/Python/3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/Applications/Xcode12.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/Applications/Xcode12.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\cuizy\AppData\Local\Programs\Python\Python36\Scripts\chromedriver.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "qiangpiao.py", line 270, in ticket.start_brush() File "qiangpiao.py", line 104, in start_brush self.driver = Browser(driver_name=self.driver_name, executable_path=self.executable_path) File "/Library/Python/3.8/site-packages/splinter/browser.py", line 90, in Browser return get_driver(driver, retry_count=retry_count, *args, *kwargs) File "/Library/Python/3.8/site-packages/splinter/browser.py", line 68, in get_driver raise err File "/Library/Python/3.8/site-packages/splinter/browser.py", line 64, in get_driver return driver(args, kwargs) File "/Library/Python/3.8/site-packages/splinter/driver/webdriver/chrome.py", line 43, in init self.driver = Chrome(options=options, kwargs) File "/Library/Python/3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/Library/Python/3.8/site-packages/selenium/webdriver/common/service.py", line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'C:\Users\cuizy\AppData\Local\Programs\Python\Python36\Scripts\chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

YouJianYue commented 1 year ago

chromedriver没配置环境变量,没指定driver路径的话,就会默认去当前py文件文件夹去查找driver文件

renhaiwen2018 commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

gxcuizy commented 1 year ago

是的,如果chromedriver没有配置环境变量,请指定绝对路径