本帖最后由 suchocolate 于 2021-7-20 16:49 编辑 from selenium import webdriver
import pyinputplus as pp
from selenium.webdriver.common.keys import Keys
browser = webdriver.Firefox()
browser.get('https://www.zentao.net/')
browser.find_element_by_link_text('登录').click()
userElem = browser.find_element_by_id('account')
username = pp.inputStr('请输入用户名: ')
userElem.send_keys(username + Keys.TAB)
pwElem = browser.find_element_by_id('password')
password = pp.inputPassword('请输入密码: ')
pwElem.send_keys(password)
subElem = browser.find_element_by_id('submit')
subElem.click()
|