Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WebHarvy GlassDoor Scraping Tick to YES/NO conversion code
els = document.getElementsByTagName('path');
var attr, node;
for (var i = els.length - 1; i >= 0; i--) {
attr = els[i].getAttribute('d');
node = null;
if(attr) {
if(attr.includes('M8.835')) {
node = document.createTextNode('YES');
} else if(attr.includes('M18.299')) {
node = document.createTextNode('NO');
}
if(node) {
els[i].parentElement.parentElement.appendChild(node);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment