Дмитрий Еремин from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome(executable_path="C:\Python35\chromedriver.exe")
#driver = webdriver.Firefox(executable_path = "C:\geckodriver.exe")
driver.get("https://directum.adm.yar.ru/Login.aspx") # Запускает браузер
#time.sleep(10) Ждет 10 сек
# Ввод логина
login = driver.find_element_by_id("sLogin")
login.clear()
login.send_keys("login")
# Ввод пароля
pswd = driver.find_element_by_id("sPwd")
pswd.send_keys("pass")
# Жмем войти
driver.find_element_by_id("btnLogin").click()
time.sleep(2) # Ждет 10 сек
button=driver.find_element_by_tag_name('button')
button.send_keys(Keys.ENTER)
time.sleep(5)
driver_new = driver.current_url
print('Новая страница: ', driver_new)
unread = []
unread=driver_new.find_element_by_class_name('under')
completed = []
completed=driver_new.find_element_by_class_name('completed')
com=[]
for i in driver_new:
if i == completed:
com.append(i)
print(com)
elif i==unread:
com.append(i)
print(com)
elif i!=unread and i!=completed:
print("Ничего не обнаружено")