Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SEO Script. Get all the People Also Ask questions from the SERP.
(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
You can’t perform that action at this time.