1

I am making a selenium bot for discord. I dont want to log in using username and password. Theres a way to login using your account token. I have the token but to proceed to you need to execute these in the Chrome Developer Tools Console

function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}

login('PASTE TOKEN HERE')

I want to know how can I execute this code from Selenium (JAVA)

  • Does this answer your question? [How to use JavaScript with Selenium WebDriver Java](https://stackoverflow.com/questions/11430773/how-to-use-javascript-with-selenium-webdriver-java) – Cebrail Yilmaz Nov 20 '21 at 06:17

0 Answers0