-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.py
More file actions
56 lines (47 loc) · 1.51 KB
/
type.py
File metadata and controls
56 lines (47 loc) · 1.51 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
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
import time
import sys
def type(str):
for i in range(len(str)):
time.sleep(.09)
print(str[i], end='')
sys.stdout.flush()
print()
def getinfo():
print("----------------------------")
type("Hello, let me type for you (⌐■_■)")
print("----------------------------")
type("your emai (☞゚ヮ゚)☞ ")
email = input()
print("----------------------------")
type("your password (☞゚ヮ゚)☞ ")
password = input()
return email, password
def login(email, password):
driver.get('https://typetest.io/login/')
driver.implicitly_wait(2)
input_email = driver.find_element(By.ID, 'email')
input_email.send_keys(email)
input_password = driver.find_element(By.ID, 'password')
input_password.send_keys(password)
btn_login = driver.find_element(By.CLASS_NAME, 'button-highlight')
btn_login.click()
def start_type():
while True:
try:
chars = driver.find_elements(By.CLASS_NAME, 'test-char')
input_field = driver.find_element(By.ID, 'test-input')
for char in chars:
time.sleep(.07)
input_field.send_keys(char.text)
except:
print("ERROR!")
email, password = getinfo()
options = Options()
options.headless = False
driver = webdriver.Firefox(options=options)
driver.implicitly_wait(2)
login(email, password)
start_type()