What is the best way to parse html in google apps script

后端 未结 6 1938
刺人心
刺人心 2020-11-30 03:08
var page = UrlFetchApp.fetch(contestURL);
var doc = XmlService.parse(page);

The above code gives a parse error when used, however if I replace the

6条回答
  •  生来不讨喜
    2020-11-30 04:06

    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.

提交回复
热议问题