diff --git a/10fastfingershack/README.md b/10fastfingershack/README.md new file mode 100644 index 0000000..68668df --- /dev/null +++ b/10fastfingershack/README.md @@ -0,0 +1,7 @@ +#Requires Selenium and Chrome Webdriver +Install selenium and specify location in the Python Script. + +This is the official website. +https://10fastfingers.com/typing-test/english + +The website serves a test for your typing speed. It can be easily automated because the words are loaded into the website during load and readily available in the source code. diff --git a/10fastfingershack/hack.py b/10fastfingershack/hack.py new file mode 100644 index 0000000..c89a646 --- /dev/null +++ b/10fastfingershack/hack.py @@ -0,0 +1,16 @@ +from selenium import webdriver +driver = webdriver.Chrome("/home/suryatej/Documents/chromedriver") +driver.get("https://10fastfingers.com/typing-test/english") +driver.maximize_window() +timer_element = driver.find_element_by_xpath('//*[@id="timer"]') +timer = timer_element.get_attribute("innerHTML") +input_element = driver.find_element_by_xpath('//*[@id="inputfield"]') +for i in range(1,350): + try: + current_word_element = driver.find_element_by_xpath('//*[@id="row1"]/span[' + str(i) +']' ) + current_word = current_word_element.get_attribute("innerHTML") + input_element.send_keys(current_word + " ") + #driver.implicitly_wait(10) + except: + break +