Last active
June 12, 2018 17:34
-
-
Save rvvvt/52c3d776b6190b8b0968cbb50b44ae7d to your computer and use it in GitHub Desktop.
outputs google's "people also searched for" results into yah console. nice.
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
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