HTML to JSON conversion