-
-
Save aswinpajayan/36f96303b27b3219714efc93395353e4 to your computer and use it in GitHub Desktop.
GSC Usernames
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
/* | |
Author: Anuraag Tummanapally | |
URL: https://www.google.com/search?q=google+scholar+iitb+ee&oq=google+scholar+iitb+ee | |
Search for: | |
google scholar iitb ee | |
in Google, then copy this code and paste in CONSOLE | |
*/ | |
var length_var=document.getElementsByClassName('LC20lb').length; | |
var names = ["names"]; | |
var unames = ["unames"]; | |
for (i =0; i<length_var; i++){ | |
try{ | |
var url=document.getElementsByClassName('iUh30')[i].innerHTML; | |
if(url.indexOf('scholar') < 0){ | |
throw i+": Error with: "+url; | |
continue; | |
} | |
names[i] = document.getElementsByClassName('LC20lb')[i].innerHTML.split(' - Google ')[0]; | |
unames[i] = document.getElementsByClassName('iUh30')[i].innerHTML.split('?user=')[1].split('&')[0]; | |
} | |
catch(e){ | |
console.log(e); | |
} | |
} | |
/* Print to console */ | |
console.table([names, unames]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment