Selenium actual combat menu job sharing after login (white moon black feather website selenium automated learning)

Insert picture description here
My homework reminder: Please enter the user name and please enter the password are successful, but the login failed 3 errors, I can not find the reason, if there is a good way, please leave a message, thank you.

from selenium import webdriver

# 创建 Webwd 实例对象,指明使用chrome浏览器驱动
wd = webdriver.Chrome(r'D:\tools-work\chromedriver_win32\chromedriver.exe')

wd.implicitly_wait(5)#等待时间 一定要写
# Webwd 实例对象的get方法 可以让浏览器打开指定网址
wd.get('http://127.0.0.1:8047/mgr/sign.html')
# 输入用户名
wd.find_element_by_id('username').send_keys("")
# 输入密码
wd.find_element_by_id('password').send_keys("88888888")
# 点击登录按钮
wd.find_element_by_tag_name('button').click()
# 打印提示框内容
print(wd.switch_to.alert.text)

wd.quit()

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_41665637/article/details/112269605