Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/Spencer-Easton/Apps-Script-htmlparser2-library

A browserified version of fb55/htmlparser2 modified to work in Google Apps Script
https://github.com/Spencer-Easton/Apps-Script-htmlparser2-library

Last synced: 4 months ago
JSON representation

A browserified version of fb55/htmlparser2 modified to work in Google Apps Script

Lists

README

        

# Apps-Script-htmlparser2-library
A browserified version of fb55/htmlparser2 modified to work in Google Apps Script

This is a library of the htmlparser2 module that has been ran through browserify and modified for Apps Script.
You can either include the source code of this library or you can link to it with the ID:

`1TLbGgQBCztnB0lOhcTYKg2UpXtpdDwocvfcx44w1tqFnHDJC5ZXy_BDo`

Example of use:

function myFunction() {
var htmlparser = htmlparser2.init();
var parser = new htmlparser.Parser({
onopentag: function(name, attribs){
if(name === "div"){
Logger.log("found div");
}
},
ontext: function(text){
Logger.log("-->" + text);
},
onclosetag: function(tagname){
if(tagname === "div"){
Logger.log("end div");
}
}
}, {decodeEntities: true});
parser.write('

outer
inner
inner 2

');
parser.end();
}


See https://github.com/fb55/htmlparser2 for more info on this library.