Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Spencer-Easton/Apps-Script-htmlparser2-library

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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('<div>outer<div>inner<br>inner 2</div></div>');
  parser.end();  
}

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.