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
- Host: GitHub
- URL: https://github.com/Spencer-Easton/Apps-Script-htmlparser2-library
- Owner: Spencer-Easton
- Created: 2017-06-05T15:12:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-05T15:26:40.000Z (about 7 years ago)
- Last Synced: 2024-01-16T12:18:25.382Z (6 months ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 24
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Lists
- google-apps-script-awesome-list - Apps-Script-htmlparser2-library
- google-apps-script-awesome-list - Apps-Script-htmlparser2-library
- awesome-appscript - Apps-Script-htmlparser2-library
- google-apps-script-awesome-list_contributorpw - Apps-Script-htmlparser2-library
- google-apps-script-awesome-list - Apps-Script-htmlparser2-library - Easton/Apps-Script-htmlparser2-library.svg?style=social&label=Star)](https://github.com/Spencer-Easton/Apps-Script-htmlparser2-library) A browserified version of fb55/htmlparser2 modified to work in Google Apps Script (Libraries & Modules / Parsing)
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.