From d757a5cff32103ba41b543b3c9cd3b9daf4b2861 Mon Sep 17 00:00:00 2001 From: Suraj Iyer Date: Tue, 8 Oct 2024 16:03:08 +0530 Subject: [PATCH] Added visitor.py file --- random/visitor.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 random/visitor.py diff --git a/random/visitor.py b/random/visitor.py new file mode 100644 index 0000000..315ae1a --- /dev/null +++ b/random/visitor.py @@ -0,0 +1,15 @@ +import webbrowser +import time +import keyboard + +count = x # number of times you want to open a tab +secs = x # time after which a tab is to be closed + +url = 'xyz' + +for _ in range (count): + # opens a new tab + webbrowser.open(url, new=0) + # closes the tab after some time + time.sleep(secs) + keyboard.press_and_release('Ctrl + W') \ No newline at end of file