Converts html scripts source to a JSON array