Created
June 16, 2022 16:29
-
-
Save kamoshi/a1b7c71f762ac598e6e9d23969d596f0 to your computer and use it in GitHub Desktop.
Sort Touhou characters in Tohosort alphabetically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
if __name__ == '__main__': | |
driver = webdriver.Firefox(executable_path="./geckodriver") | |
driver.get("https://tohosort.frelia.my/") | |
driver.find_element(By.CSS_SELECTOR, ".starting.start.button").click() | |
while True: | |
l_text = driver.find_element(By.CSS_SELECTOR, ".left.sort.text").text | |
l_button = driver.find_element(By.CSS_SELECTOR, ".left.sort.image") | |
r_text = driver.find_element(By.CSS_SELECTOR, ".right.sort.text").text | |
r_button = driver.find_element(By.CSS_SELECTOR, ".right.sort.image") | |
(l_button if l_text < r_text else r_button).click() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment