from selenium import webdriver
from selenium.webdriver import ActionChains
import time
browser = webdriver.Chrome()
browser.implicitly_wait(10)
browser.get('http://127.0.0.1:8000')
browser.maximize_window()
time.sleep(2)
elem = browser.find_element_by_id("login-button")
ActionChains(browser).move_to_element(elem).click(elem).perform()
time.sleep(2)
elem = browser.find_element_by_id("register")
ActionChains(browser).move_to_element(elem).click(elem).perform()
time.sleep(2)
email_input = browser.find_element_by_name("email")
email_input.send_keys('unicornt@163.com')
elem = browser.find_element_by_id("register-button")
time.sleep(2)
ActionChains(browser).move_to_element(elem).click(elem).perform()
url = input("input url received:")
browser.get(url)
elem = browser.find_element_by_name("usr")
elem.send_keys("unicornt")
elem = browser.find_element_by_id("pwd")
elem.send_keys("123456")
elem = browser.find_element_by_id("pwd2")
elem.send_keys("123456")
time.sleep(2)
confirm_button = browser.find_element_by_id("button")
ActionChains(browser).move_to_element(confirm_button).click(confirm_button).perform()