Advertisement
ItzStaze

Spotify.py

Feb 4th, 2017
2,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1. #python spotify login test.
  2. #/!\ If emails and passwords aren't organized 'email:pass' this will not work /!\
  3. from selenium import webdriver
  4. import os
  5. os.system('clear')
  6. acc_list = raw_input('Enter Filename: ') #EX) spotify_accounts.txt
  7. with open(acc_list) as f:
  8.     for x in f:
  9.         email, passwd = f.readlines()[0].split(':') #If emails and password are organized in a different way, you can change from where the strings are here.
  10. #TEST print("the email is {0} and the password is {1}").format(email, passwd)
  11.  
  12. browser = webdriver.Chrome()
  13. browser.get("www.spotify.com/login")
  14. email = browser.find_element_by_xpath('//*[@id="login-username"]')
  15. email.send_keys('enter your username/email')
  16. passwd = browser.find_element_by_xpath('//*[@id="login-password"]')
  17. passwd.send_keys('enter your password')
  18.  
  19. lbutton = browser.find_element_by_xpath('/html/body/div[2]/div/form/div[3]/div[2]/button')
  20. lbutton.click()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement