add get_attr

Add function to get attributes if they exist and are not empty strings. Also can check for name of element.