Skip to content

Instantly share code, notes, and snippets.

@sysnucleus
Created May 18, 2022 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sysnucleus/570e78c20ffc5dd04b54d390b4de7b85 to your computer and use it in GitHub Desktop.
Save sysnucleus/570e78c20ffc5dd04b54d390b4de7b85 to your computer and use it in GitHub Desktop.
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