A issue that pops up frequently is that the XmlService can not parse html. I took a look at what was available and found a node module htmlparser2. I ran it though browserify and modified it slightly to work as an Apps Script library. It seems to work quite well. I have the library source on my github:
https://github.com/Spencer-Easton/Apps-Script-htmlparser2-library

or you can link to it

1TLbGgQBCztnB0lOhcTYKg2UpXtpdDwocvfcx44w1tqFnHDJC5ZXy_BDo

For documentation check out the original repo for the module at:
https://github.com/fb55/htmlparser2
Shared publiclyView activity