mport timefrom selenium import webdriverfrom seleniumwebdrivercommonalert import Alertfrom seleniumwebdrivercommonkeys import Keysfrom seleniumwebdrivercommonaction_chains import ActionChains# 打开浏览器br
actions = actions.send_keys(Keys.TAB).send_keys('admin').send_keys(Keys.ENTER) actions.perform() time.sleep(3)
判断是否登录成功
if "Home" in browser.title: print("登录成功!") else: print("登录失败!")
关闭浏览器
browser.quit()
原文地址: https://www.cveoy.top/t/topic/fs2H 著作权归作者所有。请勿转载和采集!