var page = UrlFetchApp.fetch(contestURL); var doc = XmlService.parse(page);
The above code gives a parse error when used, however if I replace the
Xml.parse() has an option to turn on lenient parsing, which helps when parsing HTML. Note that the Xml service is deprecated however, and the newer XmlService doesn't have this functionality.
Xml.parse()
Xml
XmlService