def normalize_attribute(attr):
    """
    Normalizes the name of an attribute which is seplled ins lightly different
    ways in paizo HTMLs
    """
    if attr.find('a'):
        attr = attr.find('a').html() # Remove links
    else:
        attr = attr.html()
    attr = attr.strip()

    translation_map = {
        'Targets': 'Target',
        'Component': 'Components',
        'Target or Area': 'Target',
        'Target or Targets': 'Target',
        'Save': 'Saving Throw',
        'Saving': 'Saving Throw',
        'Saving throw': 'Saving Throw',
        'Casting': 'Casting Time',
        'Casting time': 'Casting Time',
        'SR':  'Spell Resistance',
        'Target, Effect, or Area': 'Area',
        'Target, Effect, Area': 'Effect',
        'Target/Effect': 'Effect',
        'Area or Target': 'Area',
    }
    if attr in translation_map:
        attr = translation_map[attr]
    assert attr in ('School', 'Level', 'Components', 'Casting Time', 'Range',
         'Effect', 'Duration', 'Saving Throw', 'Spell Resistance',
         'Target', 'Area', 'Preparation Time'
     )
    return attr.lower()