Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from time import sleep
- driver = webdriver.Chrome(r'ПУТЬ ДО SELENIUM')
- def autorization(tel, password):
- driver.get('https://lk.mts.ru')
- sleep(2)
- input_num = driver.find_element_by_id('phone')
- input_num.send_keys(tel)
- sleep(2)
- input_password = driver.find_element_by_id('password')
- input_password.send_keys(password)
- sleep(2)
- submit = driver.find_element_by_xpath("//*[@id='login']/div/div/div[4]/button/span")
- submit.click()
- def get_balance():
- try:
- popup = driver.find_element_by_class_name('popup__close')
- popup.click()
- except:
- pass
- sleep(2)
- balance = driver.find_element_by_class_name('parental-statistics-balance__item-summ').text
- return balance
- def main():
- tel = 'НОМЕР БЕЗ +7'
- password = 'ПАРОЛЬ'
- autorization(tel, password)
- sleep(5)
- print(get_balance()) # твой баланс
- driver.quit()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment