Last active
April 14, 2024 09:07
-
-
Save pbelskiy/67e69ecac22e523c6259f789d1cc15db to your computer and use it in GitHub Desktop.
How to find user name on Leetcode contest table
This file contains 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
javascript | |
(function () { | |
const username = 'pbelskiy'; | |
function find() { | |
if (document.body.innerHTML.search(username) !== -1) { | |
alert('found!'); | |
return; | |
} | |
document.getElementsByClassName('next-btn')[0].click(); | |
setTimeout(find, 1000); | |
} | |
setTimeout(find, 1000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice. I added this small line of jQuery code below, after your alert statement
$('[title='+username+']').parent().parent().css("background-color", "yellow");
This highlights the entire row of the user, so we don't have to look for it manually in that page 😉