针对打包隐藏窗口会弹出chromdriver.exe窗口的问题
找到python安装目录打开service.py
C:\Program Files\Python37\Lib\site-packages\selenium\webdriver\common\service.py
导入命令附近添加如下
from win32process import CREATE_NO_WINDOW
对service.py start修改,
self.process = subprocess.Popen(cmd, env=self.env,
close_fds=platform.system() != 'Windows',
stdout=self.log_file,
stderr=self.log_file,
stdin=PIPE, creationflags=CREATE_NO_WINDOW)
干净了,不弹窗不提示了。
python selenium打包隐藏chromdriver.exe窗口
于 2024-05-08 10:40:21 首次发布