模拟健康申报
from selenium import webdriver
from time import sleep
from PIL import Image
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.options import Options
from msedge.selenium_tools import EdgeOptions
from msedge.selenium_tools import Edge
EDGE = {
"browserName": "MicrosoftEdge",
"version": "",
"platform": "WINDOWS",
"ms:edgeOptions": {
'extensions': [],
'args': [
'--headless',
'--disable-gpu',
'--remote-debugging-port=9222',
]}
}
option = EdgeOptions()
option.add_experimental_option('excludeSwitches', ['enable-automation'])
if __name__ == '__main__':
broswer=webdriver.Edge(capabilities=EDGE)
broswer.get('https://ehall.yzu.edu.cn/infoplus/form/XNYQSB/start')
sleep(2)
user_name=broswer.find_element(By.XPATH,'/html/body/app-root/div/div[2]/div[2]/div[2]/div[1]/div[1]/app-login-normal/div/form/div[1]/nz-input-group/input')
password=broswer.find_element(By.XPATH,'/html/body/app-root/div/div[2]/div[2]/div[2]/div[1]/div[1]/app-login-normal/div/form/div[2]/nz-input-group/input')
print(user_name,password)
user_name.send_keys('200902139')
password.send_keys('@zzq5237062')
broswer.find_element(By.XPATH,'/html/body/app-root/div/div[2]/div[2]/div[2]/div[1]/div[1]/app-login-normal/div/form/div[6]/div/button').click()
sleep(0.5)
broswer.find_element(By.ID,'preview_start_button').click()
broswer.implicitly_wait(5)
broswer.find_element(By.XPATH,'//*[@id="fieldSFZX-0"]').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL121').send_keys('无')
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL128').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL129').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL130').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL138').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL115').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL109').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL111').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL114').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL133').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL135').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL137').click()
sleep(0.5)
broswer.find_element(By.ID,'V1_CTRL82').click()
sleep(0.5)
broswer.find_element(By.CLASS_NAME,'command_button_content').click()
sleep(2)
broswer.quit()
- 可以将该代码加入到任务中进行定时运行,牛逼的大佬可以试着写一个bat脚本自动化执行该代码。