#🔒 Human Benchmark Test

8 messages · Page 1 of 1 (latest)

thick iris
#

I am coding bots to automate the human benchmark test, this is out of education to learn coding and webscraping. To clarify this site has no competition and I will only do it to learn coding and because I am bored. I want to do the typing test but it won't work for me. I have followed a tutorial and it still won't work. Does anyone know how I can make it work?
code:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import keyboard
import time
import selenium

# button to start program
start_button = 'esc'

# setting up Selenium browser
browser = webdriver.Chrome()
browser.get("https://humanbenchmark.com/tests/typing")

# wait for us to start program
while True:
    if keyboard.is_pressed(start_button):
        break
    
# find elements that contain text
tic = time.perf_counter()
elements = browser.find_elements_by_class_name("incomplete")

# get complete text string for us to type
text = ""
for element in elements:
    element_text = element.text
    text += element_text if len(element_text) > 0 else ' '
    
# measure how long everything took because Selenium is slow (optional)
toc = time.perf_counter()
print(toc - tic)

# write the text
keyboard.write(text)```
crisp briarBOT
#

@thick iris

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

thick iris
#

error:
PS C:\Users\telde\OneDrive\Bureaublad\codes> & C:/Users/telde/AppData/Local/Programs/Python/Python311/python.exe "c:/Users/telde/OneDrive/Bureaublad/codes/human benchmark/typetest.py"
C:\Users\telde\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests_init_.py:102: RequestsDependencyWarning: urllib3 (1.26.16) or chardet (5.2.0)/charset_normalizer (2.0.12) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported "

DevTools listening on ws://127.0.0.1:60861/devtools/browser/ebf5e8d5-33a2-492b-9122-8b223397139d
[35284:34188:0217/220150.078:ERROR:ssl_client_socket_impl.cc(974)] handshake failed; returned -1, SSL error code 1, net_error -101
[35284:34188:0217/220150.134:ERROR:ssl_client_socket_impl.cc(974)] handshake failed; returned -1, SSL error code 1, net_error -101
Traceback (most recent call last):
File "c:\Users\telde\OneDrive\Bureaublad\codes\human benchmark\typetest.py", line 21, in <module>
elements = browser.find_elements_by_class_name("incomplete")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'WebDriver' object has no attribute 'find_elements_by_class_name'

#

I changed it to browser.find_elements("incomplete") since that is a valid option

#

error is too large

crisp briarBOT
#

@thick iris

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.