💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 添加用户代码 ~~~ from selenium import webdriver from time import sleep d = webdriver.Chrome() d.get('http://os-201804081018/blog/wp-login.php') d.maximize_window() sleep(3) # 登录系统 d.find_element_by_css_selector('#user_login').send_keys('test') sleep(3) d.find_element_by_css_selector('input[type="password"]').send_keys('test123') sleep(3) d.find_element_by_css_selector('p.submit input#wp-submit').click() sleep(3) # 点击用户 d.find_element_by_css_selector('#menu-users .wp-menu-name').click() sleep(1) # 点击添加用户 d.find_element_by_css_selector('.page-title-action').click() sleep(1) # 输入用户名 d.find_element_by_css_selector('#user_login').send_keys('test123') sleep(1) # 输入电子邮件 d.find_element_by_css_selector('#email').send_keys('test123@qq.com') sleep(1) # 点击显示密码 d.find_element_by_css_selector('.wp-generate-pw').click() sleep(1) # 清空原来密码 d.find_element_by_css_selector('#pass1-text').clear() sleep(1) # 输入新密码 d.find_element_by_css_selector('#pass1-text').send_keys('123456') sleep(1) # 确定使用弱密码 d.find_element_by_css_selector('.pw-checkbox').click() sleep(1) # 点击下拉框 d.find_element_by_css_selector('#role').click() sleep(1) # 点击角色 d.find_element_by_css_selector('[value="editor"]').click() sleep(1) # 点击添加用户 d.find_element_by_css_selector('#createusersub').click() sleep(1) d.close() d.quit() ~~~