from selenium import webdriver
import time
#导入expected_conditions预期包判断标题是否正确:
from selenium.webdriver.support import expected_conditions as EC
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("http://www.5itest.cn/register")
# EC.title_is #title_is代表现在的title和预期的title是一样的
time.sleep(5)
print(EC.title_contains("注册")) #title_contains代表只要包含就可以了
print(EC.title_contains("快乐")) #title_contains代表只要包含就可以了
print(EC.title_contains("张达")) #title_contains代表只要包含就可以了
# 结果:<selenium.webdriver.support.expected_conditions.title_contains object at 0x0000000002FDF550>标题预期结果是在内存当中