code: def get_attribute_by_name(el, name, default=None):
          
  
          value = default
          if el._is_xml:
              try:
                  value = el.attrs[name]
              except KeyError:
                  pass
          else:
              for k, v in el.attrs.items():
                  if util.lower(k) == name:
                      value = v
                      break
          return value
docs: Get attribute by name.