-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebAutomation.py
More file actions
40 lines (31 loc) · 1.07 KB
/
WebAutomation.py
File metadata and controls
40 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import tkinter as tk
from tkinter import messagebox
import webbrowser
URLS = {
"work": ["https://www.slack.com", "https://www.google.com"],
"personal": [
"https://docs.python.org/3/library/webbrowser.html",
"https://www.spotify.com",
"https://www.youtube.com"
]
}
def open_webpages(category):
urls = URLS.get(category, [])
if not urls:
messagebox.showerror("Error", "No URLs found for this category.")
return
for url in urls:
webbrowser.open(url)
messagebox.showinfo("Done", f"Opened {len(urls)} websites from '{category}'")
# GUI Window
root = tk.Tk()
root.title("Website Automator")
root.geometry("320x200")
root.resizable(False, False)
label = tk.Label(root, text="Open Website Groups", font=("Arial", 16))
label.pack(pady=10)
btn_work = tk.Button(root, text="Open Work Websites", width=25, command=lambda: open_webpages("work"))
btn_work.pack(pady=5)
btn_personal = tk.Button(root, text="Open Personal Websites", width=25, command=lambda: open_webpages("personal"))
btn_personal.pack(pady=5)
root.mainloop()