import time import pyautogui import webbrowser # Open Edge edge_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" webbrowser.register('edge', None, webbrowser.BackgroundBrowser(edge_path)) webbrowser.get('edge').open("http://bing.com") # This opens Edge to a default page # Give it a few seconds to load time.sleep(1) # Focus on the address bar pyautogui.hotkey('ctrl', 'l') # Type the URL for the Surfing game pyautogui.typewrite('edge://surf', interval=0.02) # Press Enter pyautogui.press('enter')