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.
15 lines
674 B
JSON
15 lines
674 B
JSON
{
|
||
"id": "a1-218-old-amber",
|
||
"name": "Old Amber",
|
||
"set_code": "a1",
|
||
"set_name": "Genetic Apex",
|
||
"card_number": 218,
|
||
"rarity": "Common",
|
||
"card_type": "trainer",
|
||
"image_url": "https://assets.pokemon-zone.com/game-assets/CardPreviews/cTR_10_000100_00_HIMITSUNOKOHAKU_C.webp",
|
||
"image_file": null,
|
||
"source_url": "https://www.pokemon-zone.com/cards/a1/218/old-amber/",
|
||
"trainer_type": "item",
|
||
"effect_text": "Play this card as if it were a 40 HP Basic Colorless Pokémon. At any time during your turn, you may discard this card from play. This card can’t retreat. You may play any number of Item cards during your turn.",
|
||
"illustrator": "Toyste Beach"
|
||
} |