Last active
February 19, 2020 17:40
-
-
Save fajela/b03d3a584b3512a710109109508af02e to your computer and use it in GitHub Desktop.
SEO Script. Get all the People Also Ask questions from the SERP.
This file contains hidden or 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
(function() { | |
clear(); | |
let words = []; | |
function uniq(value, index, self) { | |
return self.indexOf(value) === index; | |
} | |
let selector = 'g-accordion-expander > div:first-child div'; | |
const found = document.querySelectorAll(selector); | |
if (found.length > 0) { | |
found.forEach((f) => { | |
let text = f.textContent; | |
if (text) { | |
words.push(text); | |
} | |
}); | |
} | |
words = words.filter(uniq); | |
console.log(words.join("\n")); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment