How to use the jssoup.default function in jssoup

To help you get started, we’ve selected a few jssoup examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arslanmughal5566 / Rocket-SEO / processing / process.js View on Github external
function parseHtml(htmlBody, cb) {
    var soup = new JSSoup(htmlBody);
    // itterate all JSSoup elements array to find interesting tags
    soup.findAll().forEach(function (el) {
        // filters tags with no interest check excluded list at top
        var tag = _.find(excluded_1.default, function (tagName) {
            if (tagName === el.name) {
                return el;
            }
        });
        // concatinating all text in one place
        if (!tag && el.string !== undefined) {
            rawHtmlText += el.text + ' ';
        }
    });
    cb(rawHtmlText.replace(/"|'/g, '').toLowerCase()); // Some Keywords are wraped in "" || '' which will be replace with \s using this RegEx
}
function fromHTMLtoStringArray(siteUrl, isLocal, callback) {
github arslanmughal5566 / Rocket-SEO / processing / process.ts View on Github external
function parseHtml(htmlBody, cb) {
  const soup = new JSSoup(htmlBody);
  // itterate all JSSoup elements array to find interesting tags
  soup.findAll().forEach(el => {
    // filters tags with no interest check excluded list at top
    const tag = _.find(excluded, (tagName) => {
      if (tagName === el.name) { return el; }
    });
    // concatinating all text in one place
    if (!tag && el.string !== undefined) { rawHtmlText += el.text + ' '; }
  });
  cb(rawHtmlText.replace(/"|'/g, '').toLowerCase()); // Some Keywords are wraped in "" || '' which will be replace with \s using this RegEx
}
github TimvanScherpenzeel / detect-gpu / scripts / update_benchmarks.js View on Github external
.then(html => {
        // @ts-ignore
        const soup = new JSSoup(html.replace('', ''));
        const table = soup.find('table');
        const inputs = table.findAll('input');

        const benchmark = inputs.map(input => {
          const score = input.previousElement.text.replace(' ', '').replace('*', '');
          let name = '';

          input.previousElement.contents.forEach(row => {
            if (row.nextElement.text) {
              name = row.nextElement.text;
            }
          });

          return `${score} - ${name}`;
        });
github TimvanScherpenzeel / detect-gpu / scripts / update_benchmarks.js View on Github external
.then((html) => {
      const soup = new JSSoup(html.replace('', ''));
      const table = soup.find('table');
      const inputs = table.findAll('input');

      const benchmark = inputs.map((input) => {
        const score = input.previousElement.text.replace(' ', '').replace('*', '');
        let name = '';

        input.previousElement.contents.forEach((row) => {
          if (row.nextElement.text) {
            name = row.nextElement.text;
          }
        });

        return `${score} - ${name}`;
      });

jssoup

JSSoup is a BeautifulSoup style HTML parser library.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular jssoup functions