Converts HTML contents to JSON object