change html parsing to xml/json parsing