-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverbal_memory.py
More file actions
20 lines (17 loc) · 825 Bytes
/
Copy pathverbal_memory.py
File metadata and controls
20 lines (17 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
seen = set([])
chrome_options = webdriver.ChromeOptions()
chrome_options.add_experimental_option("detach", True)
driver = webdriver.Chrome(options=chrome_options)
driver.get("https://humanbenchmark.com/tests/verbal-memory")
time.sleep(2)
driver.find_element(By.XPATH, '//*[@id="root"]/div/div[4]/div[1]/div/div/div/div[4]/button').click()
while True:
word = driver.find_element(By.XPATH, '//*[@id="root"]/div/div[4]/div[1]/div/div/div/div[2]/div').text
if word in seen:
driver.find_element(By.XPATH, '//*[@id="root"]/div/div[4]/div[1]/div/div/div/div[3]/button[1]').click()
else:
seen.add(word)
driver.find_element(By.XPATH, '//*[@id="root"]/div/div[4]/div[1]/div/div/div/div[3]/button[2]').click()