title: How to log in to Discord using token and selenium (python)
body: <p>I wrote a code in <code>Python</code> using <code>selenium</code> model to log in to discord by <strong>token</strong> number.</p>
  <p>token number must be added to <code>localStorage</code>, so I ran javascript code to add the token and It's added, but when I go to Application -&gt; localStorage -&gt; <a href="https://discord.com" rel="nofollow noreferrer">https://discord.com</a> I am not able to see the token key and its value. Even when I refresh the page I cannot log in, but when I added it manually I can log in when I refresh the page.</p>
  <p><strong>Note:</strong> I used this line of code to add <code>token</code> to localStorage</p>
  <pre class="lang-py prettyprint-override"><code>driver.execute_script('return window.localStorage.setItem(&quot;token&quot;, &quot;value&quot;);')
  </code></pre>
  <p>Any help would be appreciated.</p>