The source website uses <span class='energy-text energy-text--type-fire'> to render inline energy icons. BeautifulSoup's get_text() was stripping these spans, losing the energy type information and causing merged text like 'Discard aEnergy' instead of 'Discard a Fire Energy'. Changes: - Add ENERGY_TEXT_TYPES mapping for inline energy references - Add replace_energy_text_spans() to convert spans to text before extraction - Add extract_effect_text() helper with proper text joining (separator=' ') - Update parse_attack(), parse_ability(), _parse_trainer_details() to use it - Fix JSON encoding in convert_cards.py to use UTF-8 (ensure_ascii=False) Before: 'Discard an Energy from this Pokémon' After: 'Discard a Fire Energy from this Pokémon' Re-scraped all 372 cards and regenerated 382 definitions.
37 lines
801 B
JSON
37 lines
801 B
JSON
{
|
||
"id": "a1-123-gengar-ex",
|
||
"name": "Gengar ex",
|
||
"card_type": "pokemon",
|
||
"hp": 170,
|
||
"pokemon_type": "psychic",
|
||
"stage": "stage_2",
|
||
"variant": "ex",
|
||
"retreat_cost": 2,
|
||
"set_id": "a1",
|
||
"rarity": "double rare",
|
||
"evolves_from": "Haunter",
|
||
"attacks": [
|
||
{
|
||
"name": "Spooky Shot",
|
||
"cost": [
|
||
"psychic",
|
||
"psychic",
|
||
"psychic"
|
||
],
|
||
"damage": 100,
|
||
"damage_display": "100"
|
||
}
|
||
],
|
||
"abilities": [
|
||
{
|
||
"name": "Shadowy Spellbind",
|
||
"effect_id": "unimplemented",
|
||
"effect_description": "As long as this Pokémon is in the Active Spot, your opponent can’t use any Supporter cards from their hand."
|
||
}
|
||
],
|
||
"weakness": {
|
||
"energy_type": "darkness",
|
||
"value": 20
|
||
},
|
||
"illustrator": "PLANETA CG Works"
|
||
} |