In this simple tutorial I'll show you how to open several websites with one click using a few lines of Python and the Webbrowser module. This is a good start if you're looking to automate different tasks like logging into websites, sending out emails, messages or automate almost any repetitive task!


# ๐ŸŒด Goal: Automate opening websites

# Steps:
# 1. Make a program that opens a list of websites
import webbrowser
import time

# Create the function
def openUrls(urls):
webbrowser.open_new(urls)

# 2. List the websites we want to open
urls = [
"https://heyalejandro.com/",
"https://www.youtube.com/watch?v=Lc5OXvJoK4s"
]

# 3. Run the program
for url in urls:
openUrls(url)
time.sleep(5)

Official documentation:
Webbrowser: docs.python.org/3/library/webbrowser.html
Time: docs.python.org/3/library/time.html