Pull all tag names or a specific tag out of an HTML snippet and count occurrences with deduplication, useful for checking page structure and cleaning markup.