Jul-14-2020, 07:22 AM
A. You need to write your code using the Python tag like i have done, otherwise people frequently don't understand what you've written.
B. Back to your code:
D. If you want this to close and re-open in a new browser (Refresh The Page) then you can just wrap the entire code in a while loop. I wouldn't advise this, there are better solutions to your requirement here.
E. What do you mean message grabber?
B. Back to your code:
import webbrowser from time import sleep # put all your imports at the top, its good practice when coding no matter the language. (Also note i did 'from time import sleep' not just 'import time'. You can just use 'import time', then in the code you need to do 'time.sleep(30)' chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s' # If you want to open the url with your default browser for easiness you can just use the code that i used. webbrowser.get(chrome_path).open('https://www.halowaypoint.com/en-us/news') # Checkout webbrowser docs for more info sleep(30) os.system("taskkill /im chrome.exe /f") # When this is run it will terminate all processes named 'chrome.exe'C. Checkout webbrowser documentation here for some information: https://docs.python.org/3/library/webbrowser.html
D. If you want this to close and re-open in a new browser (Refresh The Page) then you can just wrap the entire code in a while loop. I wouldn't advise this, there are better solutions to your requirement here.
E. What do you mean message grabber?