def get_team(self, player): team = [] xpath = "//div[@class='{}']/div[@class='trainer']/div[@class='teamicons']//span" poke_elems = self.root.find_elements_by_xpath(xpath.format(PLAYER_ELEMS[player.value])) for poke_elem in poke_elems: team.append(ShowdownPokemon.from_team_icon(poke_elem)) return team
def get_active_pokemon(self, player): xpath = "//div[@class='statbar {}']/strong".format(ACTIVE_POKE_ELEMS[player.value]) poke_elem = self.root.find_element_by_xpath(xpath) return ShowdownPokemon.from_team_icon(poke_elem)