Created
May 18, 2022 05:46
-
-
Save sysnucleus/570e78c20ffc5dd04b54d390b4de7b85 to your computer and use it in GitHub Desktop.
WebHarvy GlassDoor Scraping Tick to YES/NO conversion code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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