|
|
|
@ -348,7 +348,7 @@ def get_locations_from_bulbapedia(pokemon_name, form, cache): |
|
|
|
|
|
|
|
variant = "" |
|
|
|
for sibling in event_header.find_next_siblings(): |
|
|
|
if sibling.name == 'h4': |
|
|
|
if sibling.name == 'h4' or "held" in sibling.getText(strip=True).lower(): |
|
|
|
break |
|
|
|
if sibling.name == 'h5': |
|
|
|
variant = sibling.get_text(strip=True) |
|
|
|
@ -376,7 +376,7 @@ def get_locations_from_bulbapedia(pokemon_name, form, cache): |
|
|
|
|
|
|
|
# For Later |
|
|
|
for variant in event_tables: |
|
|
|
if variant == pokemon_name or (form and form in variant): |
|
|
|
if (variant == pokemon_name and form is None)or (form and form in variant): |
|
|
|
games_container_rows = event_tables[variant].find_all('tr') |
|
|
|
for game_row in games_container_rows: |
|
|
|
entries = game_row.find_all('td') |
|
|
|
@ -384,7 +384,9 @@ def get_locations_from_bulbapedia(pokemon_name, form, cache): |
|
|
|
games_string = entries[0].find('a').get('title') |
|
|
|
for game in all_games: |
|
|
|
if game in games_string: |
|
|
|
game_locations[game] = "Event" |
|
|
|
if game not in game_locations: |
|
|
|
game_locations[game] = [] |
|
|
|
game_locations[game].append("Event") |
|
|
|
|
|
|
|
return game_locations |
|
|
|
|
|
|
|
@ -620,9 +622,9 @@ def check_alternative_sources(pokemon, cache): |
|
|
|
if event_status: |
|
|
|
return "Event", "Event" |
|
|
|
|
|
|
|
bulb_locations = get_locations_from_bulbapedia(pokemon['base_name'], pokemon['form'], cache) |
|
|
|
if bulb_locations: |
|
|
|
return bulb_locations[0], "Bulbapedia" |
|
|
|
#bulb_locations = get_locations_from_bulbapedia(pokemon['base_name'], pokemon['form'], cache) |
|
|
|
#if bulb_locations: |
|
|
|
# return bulb_locations[0], "Bulbapedia" |
|
|
|
|
|
|
|
# Check generation introduced |
|
|
|
#generation = species_data.get('generation', {}).get('name', '') |
|
|
|
@ -649,7 +651,7 @@ def handle_unknown_encounters(pokemon_list, cache): |
|
|
|
if __name__ == "__main__": |
|
|
|
get_cached_data() |
|
|
|
|
|
|
|
pokemon_list = read_pokemon_list('pokemon_home_list.csv', limit=151) |
|
|
|
pokemon_list = read_pokemon_list('pokemon_home_list.csv', limit=3000) |
|
|
|
pokemon_list_with_games = determine_earliest_games(pokemon_list, cache) |
|
|
|
pokemon_list_adjusted = adjust_for_evolution(pokemon_list_with_games, cache) |
|
|
|
pokemon_list_with_locations = add_encounter_locations(pokemon_list_adjusted, cache) |
|
|
|
|