【发布时间】:2020-06-16 16:52:56
【问题描述】:
我使用 Python Selenium 进行网页抓取,使用批处理 .bat 文件触发它。 chrome浏览器和命令行窗口在运行成功后仍然打开。它应该被关闭,因为我将 exit 放在批处理脚本的末尾。见下面代码
timeout /t 2 /nobreak
"C:/Users/h/AppData/Local/Programs/Python/Python37/python.exe" "C:/Users/h/Desktop/Bbq/Python/Test.py"
timeout /t 12 /nobreak
exit
我想知道是否有任何错误导致了问题?请指教。
【问题讨论】:
-
您对
Exit命令的作用有一个奇怪的期望,即:Quits the CMD.EXE program (command interpreter) or the current batch script.。它与您在批处理脚本或命令窗口中运行的任何程序无关。
标签: python selenium batch-file command-line