模拟健康申报

模拟健康申报

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()
    #sleep(4)
    #设置隐式等待
    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)

    #input('按任意键结束')
    broswer.quit()
  • 可以将该代码加入到任务中进行定时运行,牛逼的大佬可以试着写一个bat脚本自动化执行该代码。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值