Browser-Scripts/surf.py

20 lines
549 B
Python
Raw Permalink Normal View History

2024-06-15 16:37:25 -07:00
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')