mirror of
https://github.com/Priyanshu-hawk/ChatGPT-unofficial-api-selenium.git
synced 2026-07-18 08:05:51 +02:00
16 lines
412 B
Python
16 lines
412 B
Python
import os
|
|
import subprocess
|
|
import time
|
|
import sys
|
|
|
|
def start_chrome():
|
|
subprocess.Popen(['google-chrome','--remote-debugging-port=9222','--user-data-dir=chromedata'],stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
|
|
|
def kill_chrome():
|
|
subprocess.run(['killall','chrome'])
|
|
|
|
if __name__ == "__main__":
|
|
if sys.argv[1] == "s":
|
|
start_chrome()
|
|
elif sys.argv[1] == "k":
|
|
kill_chrome() |