Skip to content

Instantly share code, notes, and snippets.

@Ze1598
Last active July 28, 2021 19:18
Show Gist options
  • Save Ze1598/b648c09359c61afce859c39319ccc547 to your computer and use it in GitHub Desktop.
Save Ze1598/b648c09359c61afce859c39319ccc547 to your computer and use it in GitHub Desktop.
Arknights - scrape operator level up stats
# imports, driver variable set up and loading a character page
# (...)
def get_stats_per_level(num_levels):
for i in range(num_levels):
# Code to read stats (see previous code snippet)
# (...)
# Get the arrow to increase operator level
increase_level_button = driver.find_element_by_class_name("fa-arrow-right")
# Click the button (increase 1 level)
increase_level_button.click()
# List of 3 buttons for each promotion level (E0, E1, E2)
rank_buttons = driver.find_elements_by_class_name("rank-button")
# Get stats for all the promotion levels available for the current operator
if len(rank_buttons) == 1:
# Get stats for all E0 levels
get_stats_per_level(30, main_df)
elif len(rank_buttons) == 2:
# Get stats for all E0 levels
get_stats_per_level(40, main_df)
# Now promote to E1 i.e. click the E1 button
rank_buttons[1].click()
get_stats_per_level(55, main_df)
elif len(rank_buttons) == 3:
get_stats_per_level(50, main_df)
# Now promote to E1 i.e. click the E1 button
rank_buttons[1].click()
get_stats_per_level(80, main_df)
# Now promote to E2 i.e. click the E2 button
rank_buttons[2].click()
get_stats_per_level(90, main_df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment