Refactor and standardize recording path for HTML elements.