Skip to content

Instantly share code, notes, and snippets.

@rvvvt
Last active June 12, 2018 17:34
Show Gist options
  • Save rvvvt/52c3d776b6190b8b0968cbb50b44ae7d to your computer and use it in GitHub Desktop.
Save rvvvt/52c3d776b6190b8b0968cbb50b44ae7d to your computer and use it in GitHub Desktop.
outputs google's "people also searched for" results into yah console. nice.
var data = {};
var out = [];
data.relatedsearches = [].map.call(document.querySelectorAll(".brs_col p"), e => ({ query: e.textContent }));
data.peoplesearchfor = [].map.call(document.querySelectorAll(".rc > div:nth-child(3) > div > div > div:not([class])"), e => {
if (e && !e.className) {
return { query: e.textContent };
}
});
for (d in data){
for (i in data[d]){
out.push(data[d][i]['query'])
}
}
console.log(out.join('\n'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment