I'm running this code to open Google Chrome and to send me notifications for any updates on a certain website. I've been using this open source code from: https://github.com/iholdroyd/oddsmonkey_eachway_calculator_automation/blob/master/script.py
I'm running a MacOS Mojave v 10.14.3.
I want the code to run on startup/login, which I think that I can do from System Preferences>Users and Groups>Login Items. I want the process to operate in the background and just alert me when there are any updates on the website i.e. I don't want any open windows or additional icons on my taskbar.
I added the following line of code to make the the chrome window invisible and to operate in the background:
options.add_argument("headless")
This seems to work as I am still getting notifications but there is no open chrome window. However, when I run the script there is still an open python launcher window and two terminal windows. To run the script (saved as a .py file), I have set it to Always Open with Python Launcher - I'm not sure if there's a better way to do it which reduces the number of windows which then open e.g. directly through terminal.
When I try to close the terminal window I (understandably) get the following error message:
Do you want to terminate running processes in this window?
Closing this window will terminate the running processes: Google Chrome, Google Chrome Helper (2), Google Chrome Helper (Renderer), chromedriver, Python, Google Chrome Helper (GPU).
I don't want to terminate the running processes, I just want them to operate in the background. Is there anyway that I can run the code without a terminal window having to be open on the desktop or minimised in the task bar? I've tried using automator but I'm not quite sure what to do.
I've never done any coding before so if you could let me know how to do this it would be great.
Thanks!