-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (24 loc) · 1.17 KB
/
main.py
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
from selenium import webdriver
from time import sleep
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.keys import Keys
import os
from webdriver_manager.chrome import ChromeDriverManager
options = webdriver.ChromeOptions()
options.add_argument("user-data-dir={}\driver_data".format(os.getcwd()))
# driver = webdriver.Chrome('/home/naman/chromedriver')
driver = webdriver.Chrome(ChromeDriverManager().install(), chrome_options=options)
print('Opening Chrome')
driver.get('https://10fastfingers.com/advanced-typing-test/english')
delay = 10
# cookies
# WebDriverWait(driver, delay).until(expected_conditions.presence_of_element_located((By.ID, 'CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll')))
# driver.find_element_by_id("CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll").send_keys(Keys.ENTER)
sleep(2)
word_list = driver.execute_script("return document.getElementById('wordlist').innerHTML")
words = word_list.split("|")
for i in range(len(words)):
driver.find_element_by_id("inputfield").send_keys(words[i] + ' ')
sleep(0.04)