title: node.js \ sanitize html and also remove tags
body: <p>how can I tell <a href="https://www.npmjs.com/package/sanitize-html" rel="nofollow">"sanitize-html"</a> to actually remove the html tags (keep only the content within)? currently if for example I set it to keep the div sections, in the output it writes also the <code>&lt;div&gt;some content&lt;/div&gt;</code> - I want only the inside...('some content')</p>
  
  <p>to make it short - I don't want the tags, attributes etc. - only the content of those elements..</p>
  
  <pre><code>var Crawler = require("js-crawler");
      var download = require("url-download");
      var sanitizeHtml = require('sanitize-html');
      var util = require('util');
      var fs = require('fs');
  
      new Crawler().configure({depth: 1})
        .crawl("http://www.cnn.com", function onSuccess(page) {
  
          var clean = sanitizeHtml(page.body,{
           allowedTags: [ 'p', 'em', 'strong','div' ],
          });
          console.log(clean);
          fs.writeFile('sanitized.txt', clean, function (err) {
              if (err) throw err;
              console.log('It\'s saved! in same location.');
          });
  
          console.log(util.inspect(clean, {showHidden: false, depth: null}));
          var str = JSON.stringify(clean.toString());
          console.log(str);
          /*download(page.url, './download')
          .on('close', function () {
            console.log('One file has been downloaded.');
          });*/
        });
  </code></pre>