Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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
}
.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}`;
});
.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}`;
});