[utils] Add extract_attributes for extracting html tag attributes