|
|
|
@ -681,9 +681,9 @@ def get_locations_from_bulbapedia(pokemon_name, form, cache: CacheManager, defau |
|
|
|
def process_event_tables(events_section): |
|
|
|
event_tables = {} |
|
|
|
if events_section: |
|
|
|
next_element = events_section.find_next_sibling() |
|
|
|
next_element = events_section.parent.find_next_sibling() |
|
|
|
while next_element and next_element.name != 'h3': |
|
|
|
if next_element.name == 'h4': |
|
|
|
if next_element.name == 'h5': |
|
|
|
variant = next_element.text.strip() |
|
|
|
table = next_element.find_next_sibling('table', class_='roundy') |
|
|
|
if table: |
|
|
|
@ -691,7 +691,7 @@ def process_event_tables(events_section): |
|
|
|
next_element = next_element.find_next_sibling() |
|
|
|
return event_tables |
|
|
|
|
|
|
|
def process_event_table(table, game_locations): |
|
|
|
def _process_event_table(table, game_locations): |
|
|
|
for row in table.find_all('tr')[1:]: # Skip header row |
|
|
|
cells = row.find_all('td') |
|
|
|
if len(cells) >= 3: |
|
|
|
@ -702,6 +702,48 @@ def process_event_table(table, game_locations): |
|
|
|
game_locations[game] = [] |
|
|
|
game_locations[game].append({"location": f"Event: {location}", "tag": str(cells[2])}) |
|
|
|
|
|
|
|
def process_event_table(table, game_locations): |
|
|
|
for row in table.find_all('tr')[1:]: # Skip header row |
|
|
|
cells = row.find_all('td') |
|
|
|
if len(cells) >= 6: # Ensure all required columns are present |
|
|
|
# Extract game names as a list |
|
|
|
game_links = cells[0].find_all('a') |
|
|
|
individual_games = [] |
|
|
|
|
|
|
|
for link in game_links: |
|
|
|
# Replace specific known prefixes |
|
|
|
game_name = link['title'].replace("Pokémon ", "").replace("Versions", "").replace(" Version", "").replace(" (Japanese)", "") |
|
|
|
|
|
|
|
# Split on " and ", which is used for combined games |
|
|
|
parsed_names = game_name.split(" and ") |
|
|
|
|
|
|
|
# Add the parsed names to the list |
|
|
|
individual_games.extend(parsed_names) |
|
|
|
|
|
|
|
# Print extracted game names for debugging |
|
|
|
print(f"Extracted game names from row: {individual_games}") |
|
|
|
|
|
|
|
# Filter games to include only those in all_games |
|
|
|
matching_games = [] |
|
|
|
|
|
|
|
for game in individual_games: |
|
|
|
if any(game.strip().lower() == g.lower() for g in all_games): |
|
|
|
matching_games.append(game) |
|
|
|
|
|
|
|
# Print matching games for debugging |
|
|
|
print(f"Matching games after filtering: {matching_games}") |
|
|
|
|
|
|
|
if matching_games: |
|
|
|
location = cells[2].text.strip() |
|
|
|
distribution_period = cells[5].text.strip() |
|
|
|
for game in matching_games: |
|
|
|
if game not in game_locations: |
|
|
|
game_locations[game] = [] |
|
|
|
game_locations[game].append({ |
|
|
|
"location": f"Event: {location}", |
|
|
|
"tag": str(cells[2]) |
|
|
|
}) |
|
|
|
|
|
|
|
def process_game_locations(raw_game, raw_locations, form, default_forms): |
|
|
|
locations = [] |
|
|
|
|
|
|
|
|