-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBadIdeaButtonClicker.py
More file actions
executable file
·59 lines (42 loc) · 1.19 KB
/
Copy pathBadIdeaButtonClicker.py
File metadata and controls
executable file
·59 lines (42 loc) · 1.19 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
'''
BadIdeaButtonClicker.py
Joel Goodman, 2020
@brief:
Dear Bad Idea,
Release your comics already!
Sincerely,
a rule breaker/problem causer
'''
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from time import sleep
from datetime import datetime
class ButtonClicker:
click_count = 0
url = "https://www.servethebutton.com/"
def __init__(self):
print("ButtonClicker instance created...")
def clickTheButton(self):
options = Options()
options.add_argument('-headless')
wd = webdriver.Firefox(executable_path='GeckoDriver', options=options)
wd.get(self.url)
the_button = wd.find_element_by_id("redButton")
while(True):
try:
the_button.click()
self.click_count += 1
except:
break
def main():
bad_idea = ButtonClicker()
start_time = datetime.now()
print(f'Bad idea button clicker STARTED at {start_time}')
bad_idea.clickTheButton()
stop_time = datetime.now()
print(f'Bad Idea Button Clicker STOPPED at {stop_time}')
print(f'Total duration = {stop_time - start_time}')
print(f'Total clicks = {bad_idea.click_count}')
if __name__ == "__main__":
main()