There is a script that works with selenium. You need to configure it to autostart and restart in the fall.
Tried to do through the supervisor and systemd, but the driver does not open a browser window while the process runs.
Without the code of the script will be a lot of "if...".
The algorithm is roughly like this:
1. The script launches something.
2. This is something has its own PID.
3. The script gets this PID.
4. Further, for example, the loop "while ... do" sleep with om. There are PID - skip, no PID-a - restartuem.
And the new... in a loop.