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.
38 lines
1.0 KiB
JSON
38 lines
1.0 KiB
JSON
{
|
||
"id": "a1-247-ditto",
|
||
"name": "Ditto",
|
||
"set_code": "a1",
|
||
"set_name": "Genetic Apex",
|
||
"card_number": 247,
|
||
"rarity": "Art Rare",
|
||
"card_type": "pokemon",
|
||
"image_url": "https://assets.pokemon-zone.com/game-assets/CardPreviews/cPK_20_002050_00_METAMON_AR.webp",
|
||
"image_file": null,
|
||
"source_url": "https://www.pokemon-zone.com/cards/a1/247/ditto/",
|
||
"hp": 70,
|
||
"pokemon_type": "colorless",
|
||
"stage": "basic",
|
||
"evolves_from": null,
|
||
"is_ex": false,
|
||
"abilities": [],
|
||
"attacks": [
|
||
{
|
||
"name": "Copy Anything",
|
||
"cost": [
|
||
"colorless"
|
||
],
|
||
"damage": null,
|
||
"damage_modifier": null,
|
||
"effect_text": "Choose 1 of your opponent’s Pokémon’s attacks and use it as this attack. If this Pokémon doesn’t have the necessary Energy to use that attack, this attack does nothing.",
|
||
"effect_id": null
|
||
}
|
||
],
|
||
"weakness": {
|
||
"type": "fighting",
|
||
"value": 20
|
||
},
|
||
"resistance": null,
|
||
"retreat_cost": 1,
|
||
"flavor_text": null,
|
||
"illustrator": "Jerky"
|
||
} |