87,970
社区成员
发帖
与我相关
我的任务
分享
# coding=utf-8
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("http://localhost:7001/xf/login/login.do")
dl_handle=driver.current_window_handle
print(dl_handle)
driver.find_element_by_id("loginId").send_keys("jiyaoshi")
driver.find_element_by_id("password").send_keys("123456")
# driver.find_element_by_css_selector('[type="button"]').click()
driver.find_element_by_xpath("//div[@class='login fl']/input").click()
time.sleep(3)
alert=driver.switch_to_alert()