# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/9/21
import subprocess
import time


def start_main():
    # 启动 start_mitmproxy.py 脚本的子进程
    mitmproxy_process = subprocess.Popen(['python', 'start_mitmproxy.py'])

    # 等待 mitmproxy 启动
    time.sleep(2)

    # 启动 start_selenium.py 脚本的子进程
    selenium_process = subprocess.Popen(['python', 'start_selenium.py'])

    # 等待子进程完成
    mitmproxy_process.wait()
    selenium_process.wait()


start_main()